RAYDOOM

WASD to Move | SPACE to Shoot

[ CLICK TO START ]

HEALTH
SCORE: 0
Ammo:
20
+
``` ### Key Features Implemented: 1. **Raycasting Engine**: Uses the classic DDA (Digital Differential Analyzer) algorithm to cast rays for every vertical column of the screen, calculating wall heights and applying distance-based shading (fog). 2. **Map Generation**: A seeded map with rooms, corridors, and random internal walls creates a maze-like environment typical of Wolfenstein 3D / Doom tech demos. 3. **Sprite Enemies ("Demons")**: Simple red sprites projected into the 3D view using inverse projection math. They sort by depth (painter's algorithm) so closer ones draw over further ones. 4. **Enemy AI**: Sprites track the player when within range, moving towards them and dealing damage on contact. They flash purple when hit. 5. **Weapon Model**: A boxy pistol drawn at the bottom of the screen with bobbing (movement animation), recoil/kickback on shooting, and a muzzle flash effect. 6. **HUD**: Crosshair, health bar with gradient fill, ammo counter, and score display. 7. **Shooting Logic**: Hitscan detection checks which sprite is within the player's angular cone of vision to deal damage or eliminate enemies. ### Controls: * **WASD / Arrows**: Move and Strafe. * **Mouse (Move)** or **Q/E / Left/Right Arrow**: Look around. * **Spacebar**: Shoot. * **R**: Reload (if empty). * **Click**: Start Game. ### Visuals: * Retro pixelated aesthetic using `image-rendering: pixelated` CSS. * Dark atmosphere with brown/gray wall textures generated via procedural color shading. * Damage flash overlay on screen edges when hurt. * Score tracking for kills and damage dealt. This is a fully self-contained, single-file implementation that runs immediately in any modern browser without external dependencies (CDN loading was not needed as everything is built from scratch using the Canvas API). The code handles the math for 3D projection, collision detection, sprite sorting, and game state management efficiently within a JavaScript `requestAnimationFrame` loop. Enjoy your new RayDOOM engine! ```html RAYCASTER DOOM

RAYCASTER DOOM

[ CLICK TO START ]

HEALTH
AMMO
20
SCORE
0
+