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