diff --git a/CLAUDE.md b/CLAUDE.md index 259ae89..4461829 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -79,14 +79,39 @@ This design gives players a buffer zone to recover from garbage attacks before e | `player-move` | Client->Server | `{ playerId, direction }` | | `player-rotate` | Client->Server | `{ playerId }` | | `player-drop` | Client->Server | `{ playerId, hard }` | +| `player-hold` | Client->Server | `{ playerId }` | +| `zone-activate` | Client->Server | `{ playerId }` | | `player-joined` | Server->Client | `{ player, players }` | | `player-left` | Server->Client | `{ playerId, players }` | | `game-started` | Server->Client | `{ players, states }` | | `state-update` | Server->Client | `states[]` | | `game-over` | Server->Client | `{ states }` | +### Zone Mechanic (Tetris Effect) + +Zone is a time-based attack mechanic imported from Tetris Effect. When players clear lines, their **Zone meter** fills: +- **1 line** = +15 Zone meter +- **2 lines** = +25 Zone meter +- **3 lines** = +35 Zone meter +- **4 lines (Tetris)** = +50 Zone meter + +**When Zone meter reaches 100:** +- Press **Z key** or **ZONE button** to activate Zone +- Gravity pauses for **20 seconds** +- Players control pieces manually but gravity is frozen +- Cleared lines **cascade to bottom** instead of disappearing +- After 20 seconds, Zone ends and sends garbage to opponents + +**Zone Attack Calculation:** +- Lines cleared during Zone × 1.5 = garbage rows sent +- Example: 4 Zone lines = 6 garbage rows, 8 Zone lines = 12 garbage rows +- Garbage is distributed randomly among remaining opponents + +Zone provides a high-risk, high-reward tactic for eliminating opponents with massive attacks. + ### Rendering - Each player gets a dynamically created board with canvas + info divs - `renderer.setActivePlayer()` marks current player's board as `.main`, others as `.spectator` +- Zone meter shown below each player board with fill bar and status indicator - Battle grid layout classes: `.single-player`, `.two-players`, `.multi-player` diff --git a/public/audio/tetris_theme_og.mp3 b/public/audio/tetris_theme_og.mp3 new file mode 100644 index 0000000..5c3f4bd Binary files /dev/null and b/public/audio/tetris_theme_og.mp3 differ diff --git a/public/css/style.css b/public/css/style.css index 30029a8..e5d457e 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -337,6 +337,38 @@ button:active { border: 1px solid #333; background: #000; } + +/* Zone meter styling */ +.zone-info { + font-size: 0.5rem !important; + gap: 8px; + justify-content: center; + padding: 8px 5px !important; +} + +.zone-meter-bar { + display: inline-block; + width: 100px; + height: 12px; + border: 1px solid #0ff; + background: #000; + position: relative; + overflow: hidden; +} + +.zone-meter-fill { + display: block; + height: 100%; + background: linear-gradient(90deg, #00ff00, #ffff00, #ff6600); + width: 0%; + transition: width 0.1s ease; +} + +.zone-status { + color: #fff; + font-size: 0.45rem; +} + } #game-header { @@ -554,6 +586,19 @@ button:active { font-size: 0.9rem; } +.touch-btn.zone-btn { + background: #8800ff; + border-color: #8800ff; + font-size: 0.9rem; +} + +.touch-btn.zone-btn:disabled { + background: #440088; + border-color: #440088; + opacity: 0.5; + cursor: not-allowed; +} + /* Show touch controls on mobile only */ @media (max-width: 768px) and (hover: none) { #touch-controls { diff --git a/public/index.html b/public/index.html index c0634a9..f96703e 100644 --- a/public/index.html +++ b/public/index.html @@ -10,6 +10,9 @@
+ + +