A raycasting-based 3D first-person game inspired by the classic FPS Wolfenstein 3D. Built from scratch in C using OpenGL/GLUT with no external game engine.
- Raycasting 3D Engine - Classic 1990s-style pseudo-3D rendering
- Real-time Movement - Smooth WASD controls with frame-rate independent movement
- Collision Detection - Wall collision with sliding along surfaces
- Dual View - 2D top-down map alongside 3D first-person view
- Cross-Platform - Runs on macOS, Linux, and Windows
The game uses raycasting, the same technique used in Wolfenstein 3D (1992). Instead of rendering true 3D polygons, it casts 60 rays from the player's viewpoint to detect walls. The distance to each wall determines the height of vertical lines drawn on screen, creating the illusion of 3D perspective.
| Key | Action |
|---|---|
| W | Move forward |
| S | Move backward |
| A | Rotate left |
| D | Rotate right |
gcc main.c -o wolftonian -framework OpenGL -framework GLUT
./wolftoniangcc main.c -o wolftonian -lGL -lGLU -lglut -lm
./wolftonianRequires MinGW with freeglut installed:
gcc main.c -o wolftonian.exe -lfreeglut -lopengl32 -lglu32Wolftonian/
├── main.c # Complete game implementation (single file)
├── wolftonian # macOS/Linux executable
├── main.exe # Windows executable
└── README.md
- Wall textures
- Enemies/NPCs
- Doors and portals
- Weapons and shooting
- Multiple levels
- Raycasting Tutorial (lodev.org) - Algorithm reference
MIT
