| 02-core-gameplay |
02 |
ui |
| canvas |
| game-loop |
| state-machine |
| scoring |
| pong |
| vanilla-js |
|
| phase |
provides |
| 02-core-gameplay/02-01 |
paddle2, AI module, predictive ray-cast, 3 difficulty presets, Input cleanup |
|
|
| Full game state machine (modeSelect → diffSelect → playing → scored → gameover) |
| Scoring detection (ball exits left/right edge → score1/score2 increment) |
| 1-second post-score pause with auto-serve |
| Match-end condition (first to WIN_SCORE=7 wins) |
| Mode selection UI (1=Solo vs AI, 2=2-Player) |
| Difficulty selection UI (1=Easy, 2=Medium, 3=Hard) |
| Winner overlay with "Press R to play again" |
| R-key restart (scores reset, back to modeSelect) |
| Center divider dashed line rendering |
| Score numbers rendered on canvas (top-left / top-right) |
|
| 03-menus-audio |
| 04-effects-powerups |
| 05-polish-release |
|
| added |
patterns |
|
|
| State machine pattern via gameState string field driving render/update branches |
| GameLoop owns scoring detection; Physics.update() no longer owns out-of-bounds reset |
| pauseTime field on GameLoop tracks scored-state start for 1s serve delay |
|
|
|
| GameLoop owns scoring/serve, not Physics: removed auto-reset from Physics.update() so GameLoop can increment scores before calling serveBall() |
| modeSelect state renders full-screen prompt and returns early — no physics/paddles rendered until game starts |
| pauseTime stored on GameLoop object (not GameState) — transient timing data that doesn't need to survive restart |
| Ball hidden during 'scored' pause state (gameState !== 'scored' guard on drawCircle) — clean visual signal to players |
| 2-Player mode skips diffSelect entirely — straight to playing after pressing 2 |
| Winner identity set on GameState.winner as 'player1' | 'ai' | 'player2' — AI win labeled 'AI', not 'Player 2' |
|
| State machine pattern: gameState string drives render/update branches in GameLoop.main() |
| GameLoop owns game-level events (scoring, match end, serve); Physics owns physics-level events (collision, deflection) |
|
|
~5min (continuation after human-verify checkpoint) |
2026-03-10 |