
Three.js Retro FPS
Fast-paced slice of Doom 1 and Quake 1 with satisfying movement and a brutally powerful shotgun
Prompt
Build a complete playable **boomer shooter / retro FPS inspired by Doom (1993) and Quake (1996)** with a **3D pixel-art aesthetic**, implemented as a **single self-contained HTML file using three.js**. ### Requirements #### Architecture * Everything must exist in one HTML file. * Use only three.js loaded from a CDN. * No external assets, textures, sounds, or additional files. * Generate all geometry, materials, and effects procedurally. * Keep the code clean, readable, and relatively compact. #### Game Start * Start immediately in gameplay when the page loads. * Automatically lock the mouse after the first click. * No menus, splash screens, or settings. #### Visual Style * Strong retro aesthetic inspired by Doom 1 and Quake 1. * Low-poly environments with chunky geometry. * Pixel-art look with nearest-neighbor rendering and limited colors. * Dim industrial atmosphere with colored lighting. * Weapons rendered as billboard sprites or simple low-poly models. * Simple particles for impacts and muzzle flashes. #### Movement Implement smooth and responsive movement: * WASD movement. * Mouse-look FPS camera. * Space to jump. * Shift to sprint. * Smooth acceleration when starting to move. * Smooth deceleration when releasing movement keys. * Slight momentum while airborne. * Subtle head bobbing while walking. * Smooth jump arcs with gravity. * Movement should feel weighty and polished rather than instant or floaty. #### Weapon The player only has a shotgun. Requirements: * Heavy, brutal feel inspired by classic FPS games. * Loud, satisfying firing effect created procedurally. * Strong recoil kick. * Wide pellet spread using multiple raycasts. * Visible muzzle flash. * Pump-action animation. * Short cooldown between shots. * Impact particles and blood effects. * Enemies should react when hit. #### Enemies Implement 2–3 enemy types: 1. Slow shambling melee monster. 2. Fast charging enemy. 3. Ranged enemy that periodically fires projectiles. Enemy requirements: * Simple state machine (idle, chase, attack, hurt, dead). * Basic pathing using direct movement. * Distinct colors and silhouettes. * Health system. * Damage feedback. * Death animation and corpse persistence. * Spawn several enemies around the map. #### Level Create a small arena level inspired by classic Doom maps: * Multiple connected rooms. * Hallways and elevation changes. * Pillars and cover. * Ammo pickups. * Health pickups. * A few decorative props. * Boundaries preventing leaving the level. #### HUD Display: * Crosshair. * Health. * Ammo count. * Enemy count. Use a simple retro pixel-style overlay. #### Gameplay * Shotgun shells are limited. * Pickups replenish ammo and health. * Enemies damage the player. * Restart automatically upon death. * Winning occurs when all enemies are eliminated. #### Effects Include lightweight retro effects: * Screen flash when damaged. * Muzzle flashes. * Particles. * Simple shadows. * Fog. * Dynamic lights from shots and projectiles. * Camera shake when firing. #### Performance * Maintain high frame rates. * Keep geometry and effects lightweight. * Avoid unnecessary complexity. * Prioritize gameplay feel over realism. #### Code Quality * Produce the entire implementation directly. * Do not omit sections. * Do not use placeholders or pseudocode. * Do not say “continue” or split the output. * Ensure the HTML file runs immediately when saved and opened in a browser. * Include comments only where they improve clarity. * Favor simplicity and robustness over advanced engine architecture. The result should feel like a tiny, polished, fast-paced slice of Doom 1 and Quake 1 with satisfying movement and a brutally powerful shotgun.
A system prompt was added to support web rendering