A first-person shooter concept built purely with JavaScript, HTML, and CSS — no libraries, no frameworks, no assets. Inspired by classic Doom.
Born on a Saturday with nothing else to do.
Live version: braz.dev/doom
Open index.html in a browser. That's it. No build step, no server required (though serving via HTTP avoids the file:// AudioContext warning).
Click to lock the pointer, then:
| Key | Action |
|---|---|
| W/A/S/D | Move / Strafe |
| Mouse | Look around |
| Left click | Fire |
| 1-4 | Switch weapon |
| Space | Fire |
| R | Restart (on death/win screen) |
| Toggle god mode (try typing what a Doom marine would scream) |
- Raycasting engine — DDA ray marching, textured walls, distance darkening, z-buffer
- 5 levels — connected rooms and corridors, increasing difficulty
- 8 enemy types — Zombie, Imp, Demon, Baron, Cyberdemon, Cacodemon, Lost Soul, Mancubus
- 4 weapons — Fist, Pistol, Shotgun (5 pellets), Chaingun (rapid fire)
- Boss fight — Cyberdemon in a large arena with enemy spawn waves
- HUD — Health bar, ammo, weapon selector, enemy count, level indicator
- Death / win screens — R to restart
- Sound effects — procedural via Web Audio API (no audio files)
- Background music — original procedural metal tracks, one per level
├── index.html — single page, no dependencies
├── css/style.css — fullscreen layout, overlays, loading screen
├── js/
│ ├── engine.js — raycasting renderer, enemy sprite drawing
│ ├── audio.js — Web Audio SFX + procedural music engine
│ ├── game.js — game state, levels, AI, HUD, weapons
│ └── main.js — game loop, input, pointer lock
└── README.md
GNU General Public License v3.0