Implement DAS/ARR for smooth horizontal piece movement
This commit is contained in:
@@ -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`
|
||||
|
||||
Reference in New Issue
Block a user