Log In  
Follow
frogamaker
Easy Custom 3D Engine 2.1
by
[ :: Read More :: ]

Cart #zenhewum-5 | 2024-01-31 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
12

Try to solve the maze >:)

Arrow keys to look around
ESDF/up and down arrow keys to move

--Comments in code explain how everything works, so feel free to take it apart, but ill explain here again:
the player has "raycasts" which are lines that can hit certain objects and return data, sent in front of them at different angles. When these rays hit a wall, they draw a line at a height of the reciprocal of the distance to the point that was hit. The reciprocal is used so it creates perspective (far stuff is small close stuff is big).

--IMPORTANT NOTE--
This engine is not the most effective way of doing it, as it does not store map data in strings. It is, however, easier to create maps with this one as you can simply use the built in map editor. If you are willing to lose some efficiency for an easier time, this engine is perfect for you.

--Ps. you can use this in whatever you want, just credit me (also if you don't read any of the other notes in the code at least read the last tab, that one is important)

--Version history
--1.0
--Old version with reverse fisheye effect and sprite overlapping
--Thanks to @freds72 for pointing these bugs out
--2.0 reverse fisheye fixed and sprite overlapping fixed
--2.1 minor optimizations

P#140742 2024-01-28 09:04 ( Edited 2024-01-31 04:44)

[ :: Read More :: ]

Cart #yogudeforo-0 | 2023-10-09 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
9

P#135642 2023-10-09 05:17