Commit Graph

11 Commits

Author SHA1 Message Date
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 94b524bcd7 Make ghost piece outlines more vibrant
- Increase border opacity from 50% to 80%
- Increase fill opacity from 12.5% to 25%
- Thicken border from 2px to 3px
2026-03-20 09:41:14 -07:00
jozamudi 164ed790ed Add ghost piece preview showing where block will land
- Add getGhostY() method to TetrisGame class (game.js)
- Add ghostY to getState() output
- Add getGhostY() helper to server (server/index.js)
- Include ghostY in getStates() broadcast
- Add drawGhostPiece() and drawGhostCell() methods (renderer.js)
- Ghost renders as semi-transparent outline at landing position
2026-03-20 09:37:41 -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 cde1643606 Add cache-busting version parameters to CSS and JS files 2026-03-20 08:05:06 -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 833256d18f Fix lobby: only show players who have joined
Changes:
- Added socket.join(LOBBY_ROOM) when player joins lobby
- Changed io.emit() to io.to(LOBBY_ROOM).emit() for all lobby events
- Players only see lobby events after they click JOIN LOBBY
- Fixed player list to update correctly when players join/ready
- Game now starts properly when all players are ready

Files modified:
- server/index.js: Use Socket.io rooms for lobby scoping
- public/js/app.js: Show lobby screen on player-joined event
- public/js/ui.js: Removed duplicate listener override
2026-03-20 07:30:42 -07:00
jozamudi e7917a338e Refactor to single global lobby
Changes:
- Removed room-based architecture, now using single global lobby
- Players only need to enter their name to join
- Game starts when all players in lobby are ready (min 2, max 8)
- Simplified UI - no room name field, shows "Global Lobby" header
- Updated all server events to use io.emit instead of io.to(roomName)

Files modified:
- server/index.js: Replaced rooms Map with single lobby object
- public/index.html: Removed room name input, updated button text
- public/js/network.js: Renamed joinRoom/leaveRoom to joinLobby/leaveLobby
- public/js/ui.js: Simplified join flow, removed room name validation
- public/js/app.js: Updated game header to show "GLOBAL LOBBY"
- PLAN.md: Marked all phases as complete
2026-03-20 07:09:51 -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