I have created a simple pseudo-3D game demo in MonoGame (C#) to demonstrate how the early FPS games (Wolfenstein 3D) worked.
- The world is shown as a 2D integer map (0 = empty, 1 = wall).
- For each screen column (vertical line), a ray is cast from the player’s position at an angle that falls within the camera’s field of view (FOV).
- The ray moves in small steps until it hits a wall or leaves the map.
- The distance from the hit is converted into wall slice height (the closer the wall, the taller the slice).
- Vertical slices are drawn one by one to create the 3D effect.
Source code (about 200 lines) is available on GitHub.