/extinction-protocol-arena
prompt.txt
01Act as an expert WebGL game developer. Write a complete, fully functional, 3D Third-Person Shooter game in a single HTML file using Three.js. The game should have a dark, philosophical atmosphere (inspired by Death Stranding) but styled as a PS1 demake (pixelated rendering, low-poly primitive shapes, thick fog).
02
03**Technical Constraints:**
04- STRICTLY ONE FILE: All HTML, inline CSS, and inline JavaScript must be in one file.
05- NO EXTERNAL ASSETS: Do not use external images, 3D models (.gltf/.obj), or audio files (.mp3/.wav).
06- Use Three.js primitives (Box, Cylinder, Dodecahedron) grouped together to build all models.
07- Generate procedural textures using HTML5 Canvas inside the code.
08
09**Visuals & UI:**
10- PS1 aesthetic: image-rendering: pixelated; no anti-aliasing.
11- Include a retro HUD showing: Score, Wave number, "Cargo Packs" (Health), Weapon Name, and Grenade count.
12- Implement an on-screen target lock-on reticle that snaps to enemies near the center of the screen.
13- Include a Boss HP Bar that appears during boss fights.
14
15**Player Mechanics & Controls:**
16- The player model is a low-poly figure with a mechanical arm that dynamically switches between 4 weapons: Pistol, Assault Rifle, Minigun (with spinning barrels), and Rocket Launcher.
17- The player has a shoulder-mounted "Odradek" scanner. When activated, it emits a blue pulse and shows an x-ray wireframe outline of enemies through walls.
18- PC Controls: WASD to move, Mouse to look (using PointerLock API), Left-click to shoot, Right-click to throw blood grenades, 'Q' to scan, 1-4 to switch weapons.
19- Mobile Controls: Ensure mobile support with a virtual joystick (bottom left) for movement, touch-drag anywhere for camera rotation, and 4 on-screen action buttons (Fire, Grenade, Scan, Swap).
20
21**Enemies & Bosses:**
22- Implement a wave-based system.
23- Normal enemies: Bipedal dark phantoms that leave footprints and drop tar.
24- Boss 1: Tar Lions (ensure their head/body model faces forward towards the direction of movement, not backward).
25- Boss 2 & 3: Floating Squids and Whales that drop bombs/projectiles.
26- Final Boss: A massive "Tar Walker" that spawns on wave 5. It should have destructible limbs (Arms, Legs, Head) with separate HP pools and shoot sweeping lasers.
27- When enemies die, they disintegrate into particles and drop collectable "Chiral Gold" crystals.
28
29**Environment:**
30- A wide plane with scattered hexagonal rock pillars.
31- Dynamic "Tar Ponds" that grow on the ground and spawn enemies.
32- Tar Flood event: On wave 5, the ground turns black and the sky turns red.
33- Victory Sequence: Upon beating the final boss and collecting the final crystals, the tar recedes, the ground turns green (grass), the sky turns blue, and low-poly trees and buildings procedurally rise from the ground.
34
35**Audio Engine (Web Audio API):**
36- Build a custom Sfx object using the `AudioContext` API to synthesize all sounds (no external files).
37- Include a Mute/Unmute toggle button in the top left corner of the UI.
38- Synthesize the following specific sounds:
39 1. Shooting (different oscillator pitches/waveforms for pistol, AR, minigun, and rockets).
40 2. Deep, filtered noise for Explosions (grenades/rockets).
41 3. A high-pitched, resonant sonar "ping" for the Odradek scan.
42 4. Harsh square-wave sounds for enemy death and damage taken.
43 5. Sine-wave sweeps for enemy attacks (lasers/bombs).
44 6. A triumphant arpeggio sequence for the victory screen.
45
46Ensure the code is clean, fully runnable, and beautifully structured. Provide the output in a single block of HTML code.