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 · M to mute

Destructible Cover + Polish

3 crates with 3 HP each degrade from soliddamagedcritical → destroyed. Health bars, muzzle flash, hit feedback, camera shake, Web Audio sounds. New in Step 5: high score system, game-over stats overlay, kill popups, mute toggle, and match stats.

High Scores

Scores saved per mode to localStorage — top 5 displayed on game over. Each match tracks kills, deaths, shots fired, crates destroyed, and match duration. Add ?reset=1 to URL to clear saved scores.

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 5