Modes

PvP — Two players, same keyboard
?mode=ai — You vs AI (cover state machine)
?mode=bot — Watch bots duel around cover

Controls

BlueW A S D move · SPACE fire
Red↑ ← ↓ → move · ENTER fire
R to rematch

Destructible Cover + Polish

3 crates with 3 HP each degrade from soliddamagedcritical → destroyed. New in Step 4: health bars above players, muzzle flash on fire, hit feedback (white flash + particles + camera shake), score bounce animation, and Web Audio sound effects — gunshots, hits, deaths, crate explosions, and win jingle.

Sound Effects

Sounds generated via Web Audio API — no downloads needed. Gunshots, hit thuds, death tones, crate explosions, and a win arpeggio. Audio context created lazily on first interaction to comply with autoplay policy.

Health Bars

Each player has 5 HP displayed as a bar above their sprite. Color transitions: green (full) → yellow (3-4 HP) → red (1-2 HP). On hit, player flashes white and bursts particles. At 0 HP they respawn and opponent scores a point.

Back to Tutorial

← Gun Fight Step 4