A Python‑based “Doom‑like” prototype built with Pygame and PyOpenGL. Explore a simple 3D maze rendered with GPU shaders, textured walls, floor, ceiling and animated sprites.
The entire project including this readme have been created by ai using chat GPT and codex cli. I have so far spent $30 in API costs and so am pausing for now.
- First‑person 3D raycasting with OpenGL shaders
- Textured walls, floors & ceilings
- Billboard sprites (e.g. rotating power‑ups)
- Configurable world maps (JSON)
- Smooth mouse‑look and keyboard movement
- Modular design (World, Player, Renderer, etc.)
- Python 3.8+
- pygame
- PyOpenGL
- (Optional)
PyOpenGL_accelerate
for performance - (Dev) black for code formatting
Install dependencies with:
pip install pygame PyOpenGL PyOpenGL_accelerate numpy
To install development tools:
pip install black
- Clone the repo
git clone https://github.com/daveManDaveDude/pydoom.git cd pydoom
- Run the game
python main.py
Format the code with black according to the configuration in pyproject.toml
:
black . -l 80
Most settings are in game/config.py
:
- Screen
SCREEN_WIDTH
,SCREEN_HEIGHT
,FPS
- Player
MOVE_SPEED
,ROT_SPEED
- Mouse
MOUSE_SENSITIVITY
,MOUSE_SENSITIVITY_Y
,MAX_PITCH
- Textures & World
FLOOR_TEXTURE_FILE
,WALL_TEXTURE_FILE
, etc.WORLD_FILE
points to a JSON map ingame/worlds/
(must exist and define a 2Dmap
array)
- Map Tiles
TILE_EMPTY
(0),TILE_WALL
(1) for future tile-type extensions
-- W / Up Arrow: Move forward -- S / Down Arrow: Move backward -- A / Left Arrow: Strafe left -- D / Right Arrow: Strafe right -- Mouse: Look around (yaw & pitch) -- Spacebar or Left Click: Fire bullet -- P: Toggle pause/unpause -- X key or window close: Quit
pydoom/
├── game/
│ ├── config.py # Constants & settings
│ ├── game.py # Main loop & high‑level coordination
│ ├── player.py # Player state & movement logic
│ ├── world.py # Map loading & collision
│ ├── renderer.py # OpenGL‑based rendering
│ ├── wall_renderer.py # CPU-based wall casting implementation
│ ├── gl_utils.py # Shader & texture helpers
│ ├── gl_resources.py # Resource manager for GL objects
│ ├── shaders/ # GLSL shader sources
│ ├── textures/ # PNG assets (walls, floor, sprites…)
│ └── worlds/ # Sample map layouts
│ └── default.json # Sample map layout
├── main.py # Entry point
├── .gitignore
└── README.md # ← You are here
- Maps: Add or modify JSON files under
game/worlds/
. A map JSON should define a 2D grid (map
) and optionalpowerup
orsprites
entries. - Textures: Place new
.png
files ingame/textures/
and updateconfig.py
to point at them.
Run the full test suite with pytest from the project root:
pytest -q
- Fork the project
- Create a feature branch (
git checkout -b feature/YourFeature
) - Commit your changes
- Push to your branch & open a Pull Request.
- If possible don't write any code yourself, lets see how far we can take 100% AI driven development!
Open Source MIT licence
For questions or suggestions, open an issue or reach out via GitHub discussions.