Skip to content

Add playable snooker and pool game modes with full game logic#16

Open
TimBeyer wants to merge 3 commits intomasterfrom
claude/build-snooker-pool-game-UigtL
Open

Add playable snooker and pool game modes with full game logic#16
TimBeyer wants to merge 3 commits intomasterfrom
claude/build-snooker-pool-game-UigtL

Conversation

@TimBeyer
Copy link
Copy Markdown
Owner

Implements a complete game system on top of the existing analytical physics engine:

  • Pocket physics: segmented cushion detector (walls with gaps at pocket mouths),
    quartic pocket detector (ball enters pocket acceptance circle), BallPocketed
    event type, ball removal from simulation
  • Game logic abstraction: GameRules interface with swappable implementations
    for 8-Ball, 9-Ball, and Snooker. GameController orchestrates turns, shot
    evaluation, scoring, fouls, and win conditions
  • Cue shot input: pointer-based aiming with raycasting to table plane, power
    bar, spin circle widget, trajectory preview (analytical first-contact using
    existing quartic detector), 3D cue stick visual
  • App routing: hash-based mode switching between main menu, game modes, and
    sandbox (existing debug environment extracted to sandbox.ts)
  • React UI: MainMenu for mode selection, GameUI with score bar, foul banners,
    aim controls, game-over overlay. Mobile-friendly with touch support

All 304 existing tests pass. Sandbox mode behavior is unchanged.

https://claude.ai/code/session_019uv6WooZ9HWdCoc92bgzwA

Implements a complete game system on top of the existing analytical physics engine:

- Pocket physics: segmented cushion detector (walls with gaps at pocket mouths),
  quartic pocket detector (ball enters pocket acceptance circle), BallPocketed
  event type, ball removal from simulation
- Game logic abstraction: GameRules interface with swappable implementations
  for 8-Ball, 9-Ball, and Snooker. GameController orchestrates turns, shot
  evaluation, scoring, fouls, and win conditions
- Cue shot input: pointer-based aiming with raycasting to table plane, power
  bar, spin circle widget, trajectory preview (analytical first-contact using
  existing quartic detector), 3D cue stick visual
- App routing: hash-based mode switching between main menu, game modes, and
  sandbox (existing debug environment extracted to sandbox.ts)
- React UI: MainMenu for mode selection, GameUI with score bar, foul banners,
  aim controls, game-over overlay. Mobile-friendly with touch support

All 304 existing tests pass. Sandbox mode behavior is unchanged.

https://claude.ai/code/session_019uv6WooZ9HWdCoc92bgzwA
@cloudflare-workers-and-pages
Copy link
Copy Markdown
Contributor

cloudflare-workers-and-pages bot commented Mar 29, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
balls bf0a09c Commit Preview URL

Branch Preview URL
Mar 29 2026, 04:15 PM

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 29, 2026

Benchmark Comparison

Benchmark Baseline (ops/sec) PR (ops/sec) Change
10 circles / 60s 1145.38 1257.38 +9.78%
20 circles / 60s 533.87 535.90 +0.38% ➡️
40 circles / 60s 208.75 214.47 +2.74%
80 circles / 60s 44.38 34.10 -23.17% 🔴
150 circles / 60s 3.69 3.63 -1.49% ➡️
300 circles / 60s 2.25 2.30 +2.06%
500 circles / 60s 1.64 1.65 +0.57% ➡️
1000 circles / 60s 1.09 1.08 -0.76% ➡️

Overall: +5.64% ✅


Merge base: 68672bb | PR commit: bf0a09c | 2026-03-29 16:15 UTC

Previous runs

Benchmark Comparison

Benchmark Baseline (ops/sec) PR (ops/sec) Change
10 circles / 60s 1050.34 1277.22 +21.60% 🚀
20 circles / 60s 581.90 559.49 -3.85% ⚠️
40 circles / 60s 228.72 225.96 -1.21% ➡️
80 circles / 60s 45.71 46.20 +1.08% ➡️
150 circles / 60s 3.82 3.62 -5.05% ⚠️
300 circles / 60s 2.36 2.30 -2.93% ⚠️
500 circles / 60s 1.70 1.71 +0.30% ➡️
1000 circles / 60s 1.14 1.14 -0.24% ➡️

Overall: +10.54% 🚀


Merge base: 68672bb | PR commit: d43aa2f | 2026-03-29 16:04 UTC

Benchmark Comparison

Benchmark Baseline (ops/sec) PR (ops/sec) Change
10 circles / 60s 1220.98 1195.29 -2.10% ⚠️
20 circles / 60s 581.70 564.10 -3.03% ⚠️
40 circles / 60s 227.50 218.60 -3.91% ⚠️
80 circles / 60s 45.77 43.54 -4.87% ⚠️
150 circles / 60s 3.80 3.65 -3.77% ⚠️
300 circles / 60s 2.35 2.23 -5.00% ⚠️
500 circles / 60s 1.68 1.70 +0.93% ➡️
1000 circles / 60s 1.14 1.13 -0.96% ➡️

Overall: -2.62% ⚠️


Merge base: 68672bb | PR commit: a44114e | 2026-03-29 16:02 UTC

claude added 2 commits March 29, 2026 16:03
The UI overlay container has pointer-events: none to avoid blocking the 3D
scene. The MainMenu was missing pointer-events: auto, so all clicks passed
through it without registering.

https://claude.ai/code/session_019uv6WooZ9HWdCoc92bgzwA
On mobile, single-finger touch and camera gestures were fighting over the
same pointer events, making it impossible to control both.

Changes:
- CueInput now tracks active touch count: single finger = aim, two fingers
  = camera (OrbitControls). Multi-touch temporarily enables OrbitControls.
- Pointer-up no longer auto-fires a shot. Shooting requires the explicit
  SHOOT button (prevents accidental shots from finger lifts).
- Added Aim/Camera mode toggle button for explicit switching.
- Added prominent circular SHOOT button at bottom-center.
- SimulationScene exposes getOrbitControls() so game.ts can wire it up.
- Desktop: double-click to shoot as convenience shortcut.

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