Skip to content

Add Pineapple Portal Golf — two-player grid flicking game with portal holes - #16

Draft
msfeldstein wants to merge 1 commit into
masterfrom
cursor/portal-golf-game-191e
Draft

Add Pineapple Portal Golf — two-player grid flicking game with portal holes#16
msfeldstein wants to merge 1 commit into
masterfrom
cursor/portal-golf-game-191e

Conversation

@msfeldstein

Copy link
Copy Markdown
Owner

What this is

A self-contained two-player web game in portal-golf/ (plain HTML/CSS/JS, no dependencies, no build step — just open portal-golf/index.html or serve the folder statically).

Chaos mode gameplay with revealed portals
Turn-based mode with mystery portals

Rules

  • A grid board with scattered walls, three pairs of sibling portal holes, and a gold 🍍 target hole. Boards are randomly generated (with validation that holes/target stay reachable and home columns stay clear).
  • Each player (Pink vs Cyan) has 5 balls. Swipe a ball in a direction and it slides until it hits a wall or another ball (stops in the cell before), a portal hole (falls in and pops out resting at its sibling hole), or the target hole (captured, scores a point).
  • A ball resting in a hole plugs it: incoming balls roll straight over the paired hole instead of teleporting, and block arrivals at the plugged hole like any other ball.
  • First player to sink 3 balls into the target hole wins.

Modes and options

  • Turn-based: alternate flicks; input locks while a ball is rolling, and a throw straight into an adjacent wall/ball is rejected so it doesn't waste a turn.
  • Chaos: no turns — both players flick their balls as fast as they can, simultaneously.
  • Portals: Revealed / Mystery: revealed mode colour-codes sibling holes and draws dashed links between them; mystery mode makes every hole look identical so you learn the pairings by playing.

iPad / touch support

  • Pointer-events based input with per-pointer tracking, so two players can aim and throw at the same time on one screen (multitouch).
  • touch-action: none, viewport pinned, iOS gesture/double-tap-zoom suppression, and safe-area insets so it plays cleanly full-screen on an iPad.
  • Aim arrows render while dragging; works with a mouse on desktop too.

Testing

  • 14 headless rule tests (sliding, wall/ball/edge collisions, teleporting, hole plugging and pass-over, target capture and scoring, throw rejection, turn handover, win at 3, chaos head-on collisions, throwing a ball off a hole it's plugging, and validity of 100 random boards) — all pass.
  • Driven end-to-end in headless Chrome with real touch-swipe events (both players, both modes, off-turn grab rejection, turn switching) — all pass, no console errors.

To show artifacts inline, enable in settings.

Open in Web Open in Cursor 

…holes

Co-authored-by: Michael Feldstein <msfeldstein@users.noreply.github.com>
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