Skip to content

Pac-Man: row/column push mechanic with hidden dots#19

Open
bster wants to merge 2 commits into
mainfrom
claude/pacman-row-push
Open

Pac-Man: row/column push mechanic with hidden dots#19
bster wants to merge 2 commits into
mainfrom
claude/pacman-row-push

Conversation

@bster

@bster bster commented Mar 29, 2026

Copy link
Copy Markdown
Owner

Summary

Replaces the letter-eating mechanic with a sliding-puzzle push system:

  • Moving horizontally: Pac-Man pushes the entire row of CV text he's passing through — letters slide in his direction and wrap around the screen edge
  • Moving vertically: Pac-Man pushes a column lane (chars within ±26px of his X) up/down with the same wrapping
  • Each letter hides a dot at its original position; the dot is revealed once the letter has been pushed ≥14px away
  • Pac-Man eats exposed dots for 10pts each — all dots eaten = win

What changed

  • offsetX / offsetY added per char in pBuildLayout(); chars render at ((baseX + offsetX) % W + W) % W
  • pDots[] parallel array — one dot per char at original center position
  • pWrappedDisp() — shortest signed displacement on a wrapped axis (handles chars that have lapped the screen)
  • Removed reflowChars call, pEaten[] array, and pContentLeft/Right

Test plan

  • Moving right/left visibly slides the current text row; letters wrap from one edge to the other
  • Moving up/down slides a vertical lane of chars
  • Dots appear (brown dots) at original letter positions once letters have moved away
  • Pac-Man eats dots when he passes over them; score increments by 10
  • Ghosts still chase and kill; lives decrement correctly; respawn works
  • Clearing all dots shows win overlay and score modal
  • Game over after 3 deaths shows overlay
  • Swipe controls work on mobile

https://claude.ai/code/session_01WxbFVLK8AGoBvQE2MKh3kw

Pac-Man now pushes entire rows of CV text left/right as he moves
horizontally through them (±22px Y band). Moving vertically pushes
a column lane of chars (±26px X band). Letters wrap around the
screen on both axes.

Each letter hides a dot at its original position. Once a letter has
been pushed ≥14px away, the dot is exposed. Pac-Man eats exposed dots
for 10pts each. All dots eaten = win.

Removes: reflowChars call, individual letter eating, pEaten array.
Adds: offsetX/offsetY per char, pDots parallel array, pWrappedDisp().

https://claude.ai/code/session_01WxbFVLK8AGoBvQE2MKh3kw
@netlify

netlify Bot commented Mar 29, 2026

Copy link
Copy Markdown

Deploy Preview for benstern ready!

Name Link
🔨 Latest commit 306877c
🔍 Latest deploy log https://app.netlify.com/projects/benstern/deploys/69c9467f35f4a00008e1b863
😎 Deploy Preview https://deploy-preview-19--benstern.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

- game.js: ripple wave displaces nearby alive letters on kill
  (expanding ring at 4.5px/frame, sin() displacement up to 7px,
  30px bandwidth, fades over ~33 frames)
- pacman.js: remove invincibility blink — Pac-Man always visible

https://claude.ai/code/session_01WxbFVLK8AGoBvQE2MKh3kw
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.

2 participants