Skip to content

Add orbit-dodger minigame with pointer/keyboard directional input - #2

Merged
salamancacm merged 1 commit into
mainfrom
feat/orbit-dodger-minigame
Jul 31, 2026
Merged

salamancacm merged 1 commit into
mainfrom
feat/orbit-dodger-minigame

Conversation

@salamancacm

Copy link
Copy Markdown
Owner

Summary

  • New second built-in minigame, orbit-dodger: dodge obstacles falling from the top by moving the ship left/right, original chevron-ship + faceted-gem art (distinct from dino-runner's visual language).
  • Extends InputState/InputController with heldDirection (Arrow keys / WASD, held) and pointerX ("follow the pointer" drag/touch, canvas-local logical pixels) — purely additive, dino-runner is unaffected.
  • Extracts mulberry32 and the generic AABB intersects() check into src/games/shared/ so both games reuse the same PRNG/collision primitives instead of duplicating them.
  • Wires ?game=orbit-dodger into all four example apps (vanilla, react-vite, nextjs, angular) so both games are reachable without extra setup.
  • Documents the new game and InputState fields in the README.

Test plan

  • npm test — 135/135 passing (30 new: shared rng/collision, orbit-dodger movement/fallers/collision/index, extended InputController pointer/keyboard tests).
  • npm run lint — clean.
  • npm run build — core/react/angular entries all build.
  • npm run size — core bundle 6.86 KB gzip (was 5.72 KB before this change), well under the 15 KB budget.
  • Manual: confirmed ?game=orbit-dodger mounts the canvas with no console errors in examples/vanilla. Pixel-level visual verification wasn't possible in this environment (the preview browser pane doesn't actively composite frames, so requestAnimationFrame is paused) — relying on the automated test suite (including a "render doesn't throw" test) for render-path coverage instead.

Extends InputState/InputController with heldDirection (Arrow keys/WASD)
and pointerX (follow-the-pointer drag) so games beyond the single-button
dino-runner jump are possible. Extracts mulberry32 and the AABB collision
check into src/games/shared/ for reuse. Adds orbit-dodger: dodge falling
obstacles by moving the ship left/right, original chevron-ship and
faceted-gem art. Wires ?game=orbit-dodger into all four example apps and
documents the new game/InputState fields in the README.
@salamancacm
salamancacm merged commit 7b62c8c into main Jul 31, 2026
2 checks passed
@salamancacm
salamancacm deleted the feat/orbit-dodger-minigame branch July 31, 2026 19:41
@salamancacm salamancacm mentioned this pull request Aug 1, 2026
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