Add playable snooker and pool game modes with full game logic#16
Open
Add playable snooker and pool game modes with full game logic#16
Conversation
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
Contributor
Deploying with
|
| 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 |
Benchmark Comparison
Overall: +5.64% ✅ Merge base: Previous runsBenchmark Comparison
Overall: +10.54% 🚀 Merge base: Benchmark Comparison
Overall: -2.62% Merge base: |
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
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.
Implements a complete game system on top of the existing analytical physics engine:
quartic pocket detector (ball enters pocket acceptance circle), BallPocketed
event type, ball removal from simulation
for 8-Ball, 9-Ball, and Snooker. GameController orchestrates turns, shot
evaluation, scoring, fouls, and win conditions
bar, spin circle widget, trajectory preview (analytical first-contact using
existing quartic detector), 3D cue stick visual
sandbox (existing debug environment extracted to sandbox.ts)
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