buddy/apps: add brickbreaker game - #4
Open
lisabee123 wants to merge 1 commit into
Open
Conversation
A self-contained breakout-style game alongside snake.py /
hello_cardputer.py. Same suite conventions:
- 240x135 chrome, ORANGE hairline header, hint strip footer,
shared 5-color palette so it reads as part of the same device.
- MatrixKeyboard polled at 40 ms with `kb.tick()` + `kb.get_key()`.
Two control schemes:
A/D (gamer default)
`,` / `/` (Cardputer arrow-cluster glyphs)
W / `;` / Space launches the ball and acts as restart on the
end screen. Q / ESC exits via `machine.reset()` in `finally`,
same no-return-to-launcher pattern UIFlow 2.0 forces on us.
- Single file in buddy/device/apps/ — no shared peer modules, so
it installs with one `install_apps.py` upload.
Gameplay: 8x4 brick wall (32 bricks), 3 lives, 5-zone paddle
reflection, AABB ball-brick collision with dominant-axis reversal
to avoid corner-clip artifacts. Top row scores 4, bottom 1 (top
is hardest to reach last). Ball steps 2 px/axis at 40 ms = 50 px/s
per axis, fast enough to play, slow enough that all collisions
register at 7 px brick height.
Tested via py_compile; behavior tested live on a Cardputer-Adv
provisioned with this bundle.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a Breakout-style game to
buddy/device/apps/— fourth app in the suite alongside Claude Buddy, Hello, and Snake. Single self-contained file, same chrome / input model / exit pattern as the other apps so the launcher picks it up automatically and it feels like a native member of the bundle.Tested live on a Cardputer-Adv provisioned with this bundle.
What's in it
MatrixKeyboardpolled at 40 ms (the loop shapesnake.pyandhello_cardputer.pyalready use). Two control schemes:,//as the Cardputer arrow-cluster equivalentsmachine.reset()infinally, the same no-return-to-launcher fallbackclaude_buddyandsnakeuse)Why a fourth app
The bundle was built around BLE (Claude Buddy) plus a couple of offline games for attendees who haven't unlocked the Claude Desktop dev menu yet. Snake covers grid-based; brickbreaker covers timing-and-aim. Both pure-LCD-and-keyboard so they work without WiFi or Claude Desktop, which matters at events where the network is the most flaky thing in the room.
Notes for review
buddy_ble.py,buddy_chars.py, etc.) aren't touched.brickbreaker.pyinlines its own palette so it can be installed standalone viainstall_apps.py --src <path>if someone wants only the game._BALL_STEP— but watch for tunneling at any value where_BALL_STEP * 2 >= _BRICK_H.Test plan
python -m py_compile buddy/device/apps/brickbreaker.pypassesinstall_apps.py --src buddy; appears in the launcher🤖 Generated with Claude Code