Walking around in 3D
arrow keys, WASD, or the buttons
What it takes to build
How it works: here's the secret — there is no 3D. The maze is a grid of 1s and 0s, typed out as ten lines of text. What you're seeing is a trick.
For each of the 150 vertical strips across the screen, fire an imaginary ray out from you into the grid, stepping forward until it hits a wall. Measure how far it went. Close wall → draw a tall bright strip. Far wall → draw a short dark one. Do that across the screen and your eye assembles a corridor.
One correction matters: multiply the distance by the cosine of the angle from centre. Without it the walls bulge like a fisheye lens. That one line is the difference between "3D game" and "funhouse mirror".
This is how Wolfenstein 3D worked in 1992, and it ran on computers slower than your calculator.
What to ask for:
Raycasting first-person renderer on canvas from a grid map of 1s and 0s. Cast one ray per 2px column across a 60 degree field of view, step until it hits a wall, and draw a vertical strip whose height is inversely proportional to distance. Multiply distance by cos(angle - direction) to remove the fisheye. Darken with distance. Arrow keys plus on-screen buttons, and stop me walking through walls.