Movement: WASD Turn: left/right arrows
Feel free to use this raycasting engine for any project as long as you credit me. The list of lines tells where walls are in the 2D map. Each line is 5 values: x1, y1, x2, y2, color (the color corresponds to the color slider in the pen tool) This raycaster renders the proper 2.5D scene. By "proper", I mean that there is no fisheye effect or other curving artifacts. The main fisheye problem is fixed by using the "depth" from the player in the direction the player is facing instead of the distance from the player. Another curving artifact occurs when rays are equally spaced in terms of angles. It is fixed by making them equally spaced in terms of where they hit an imaginary screen spanning the field of view.