Commit Graph

11 Commits

Author SHA1 Message Date
callylin 3a307dbc80 Implement DAS/ARR for smooth horizontal piece movement 2026-03-24 17:59:55 -07:00
jozamudi e3f594e44e Show garbage received on player elimination
- Add garbageReceived array to player objects
- Track garbage in addGarbageToPlayer() with sender name
- Include garbageReceived in getStates() output
- Update endGame() to pass garbage stats to UI
- Update showGameOver() to display garbage count per player
- Add CSS styling for eliminated players and garbage column
- Bump CSS version for cache refresh

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-21 02:44:39 +00:00
jozamudi bdeb6c8849 Fix garbage elimination bug and align board with header
- Change y-- instead of y++ when pushing piece up on garbage
- Add y < 0 check to properly detect piece pushed off top
- Remove margin-top from battle grid to align with header

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-21 01:07:21 +00:00
jozamudi a0ab4ff5cd Add spectator mode for late-joining players
- Server: Late joiners are added as spectators instead of players
- Server: Send forced-spectator event only to joining spectator (not broadcast)
- Server: Track spectators separately and move them to players after game ends
- Client: Handle forced-spectator event to show all player boards
- Client: Spectators see all boards equally without main/spectator highlighting
- Client: Mobile view shows scrollable vertical list of all boards for spectators
- Fix: All cleared lines are sent as garbage to each opponent (not randomized)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 18:26:48 +00:00
jozamudi 37b4170552 Keep piece previews visible on mobile
- Remove display: none from next/hold previews
- Scale down preview canvases to 50x50px on mobile
- Reduce gap and padding for tighter layout
2026-03-20 09:53:19 -07:00
jozamudi e5a5e0eda9 Optimize mobile UI with scaling and reduced info
Option 2: Scale battle grid to 70% on mobile
Option 4: Reduce board-info padding and font size, hide next/hold previews
2026-03-20 09:52:26 -07:00
jozamudi 708b1466d6 Change game over overlay to vertical layout 2026-03-20 09:22:38 -07:00
jozamudi 4a49c76cdc Add hold piece feature
- Added holdPiece and canHold state to TetrisGame class
- Implemented hold() method to swap current piece with held piece
- Added player-hold socket event on server
- Added HOLD preview canvas showing held piece (grayed when unavailable)
- Added C key keyboard shortcut and touch button for hold
- Fixed canHold reset on piece spawn for proper swap functionality

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 08:50:52 -07:00
jozamudi bc89948584 Create focused arena layout with main player centered
- Main player board is large and centered with cyan glow
- Opponent boards are smaller (50% scale) and positioned around edges
- Layout adapts for 1, 2, or 3+ players
- Spectator boards have reduced opacity to reduce distraction
2026-03-20 08:01:25 -07:00
jozamudi 45f6d0d0c3 Show game over as overlay on top of game screen
- Make gameover-screen a fixed overlay with semi-transparent background
- Removed 'screen' class from gameover-screen element
- Game scene remains visible behind game over overlay
2026-03-20 07:55:36 -07:00
jozamudi 5da6033704 Initial commit: Tetris Battle Royale multiplayer game
Features:
- 2-8 player multiplayer via Socket.io WebSocket
- Real-time board synchronization - all players see all boards
- Battle royale mechanic: clearing rows sends garbage to opponents
- Classic Tetris gameplay with all 7 tetrominoes
- Retro visual styling with CRT scanlines and pixel font
- Automatic level progression and speed increase
- Player elimination and winner announcement

Files:
- server/index.js: Node.js + Socket.io game server
- public/js/: Frontend game logic, rendering, network, and UI
- public/css/style.css: Retro Tetris styling
- README.md: Setup and usage instructions
- PLAN.md: Implementation plan with all phases completed
2026-03-20 00:34:06 -07:00