Skip to content

Add Pong game (1-player vs AI)#4

Open
steemandavid wants to merge 2 commits into
Tom-Michiels:mainfrom
steemandavid:pr/pong
Open

Add Pong game (1-player vs AI)#4
steemandavid wants to merge 2 commits into
Tom-Michiels:mainfrom
steemandavid:pr/pong

Conversation

@steemandavid

Copy link
Copy Markdown

Summary

  • Classic 1-player Pong against an AI paddle
  • Tilt left/right to move your paddle along the bottom row
  • AI opponent tracks the ball with slight delay for balanced difficulty
  • Score counts volleys; game resets after 3 misses

Files Changed

  • main/game_pong.c — new game implementation
  • main/main.c — add to dispatch table
  • main/game_common.h — add GAME_PONG to enum
  • main/CMakeLists.txt — add to SRCS

Note: This PR builds on top of PR #3 (refactor). Please review/merge that first.

Testing

  • Built and flashed on ESP32-C3 hardware
  • Tilt control responsive, AI provides fair challenge
  • Score and miss tracking work correctly

steemandavid and others added 2 commits May 12, 2026 22:37
Extract the 1643-line main.c into separate compilation units:
- display.c/h (WS2812 LED driver, pixel drawing, HSV conversion)
- accel.c/h (I2C, ADXL345 driver, calibration)
- game_common.h (shared types, macros, game enum)
- game_*.c (one file per game, 9 files)

No behavior changes. All 9 original games work identically.
CLAUDE.md and README.md updated to reflect new file structure.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
Classic 1-player Pong against an AI opponent. Tilt left/right
to move your paddle. Score counts volleys; game resets after
3 misses.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant