Physically simulated pool game. Work in progress.
-
Common controls
- Click and drag anywhere to rotate the camera around the focal point ✅
- Zoom into the focal point with the mousewheel ✅
-
Placing the cue ball in hand
- The focal point is at the center of the table ✅
- Hover over the table to choose where to place the cue ball ✅
- The cue ball is rendered in gray when it overlaps with other objects ✅
- Click to place the cue ball if it is not overlapping with other objects ✅
-
Aiming and shooting
- The focal point is at the cue ball ✅
- The camera angle defines the azimuth of the cue ✅
- Click and hold on the cue ball to set the hit point, move cursor while pressed to set the cue elevation ✅
- The cue is rendered in gray if it overlaps with other objects ✅
- Press and hold the "Space" button to set the force ✅
- Release the "Space" button to shoot ✅
-
Simulating
- The focal point is where it was before ✅
- The camera is zoomed out to show the table (unless interrupted with the mousewheel) ✅
The game format is two (2) player 8-Ball. It is a simplified version of WPA 8-Ball rules. The goal is to successfully pocket all seven (7) of one group (solids or stripes) without pocketing the cue ball, then pocket the 8-ball.
-
Getting started
- Rack the balls ✅
- Place the cue ball behind the head string ✅
-
Target group
- View the current target group ✅
- The table is considered "open" until someone has pocketed a solid or stripe without scratching ✅
- When the table is open, pocketing balls in only one of the solids or stripes group without scratching sets the target for that player ✅
-
During play
- View the current player ✅
- Add shot with shot events ✅
- Place ball in hand ✅
- Check if shot is legal, that is, if the player has hit their target ball with the cue before any other, and some ball has hit a rail or went into a pocket ✅
- On scratch, require the next player to place the cue ball anywhere on the table (ball-in-hand) ✅
- If a player does not pocket one of their balls or scratches, the current player switches ✅
- Ensure balls are pocketed only once or send an error
- Support spotting 8 ball when it falls off the table during break ✅
-
Winning the game
- If a player has pocketed all of their target balls and makes the 8-ball without scratching, they win ✅
- When a player has pocketed all of their target balls and makes the 8-ball but scratches, they lose ✅
- If a player pockets the 8-ball before all of their target balls, they lose ✅
We are using the nix package manager, that can be installed following these instructions. To activate the flakes feature, include experimental-features = nix-command flakes
in ~/.config/nix/nix.conf
(create this file if it doesn't exist).
Then, run nix develop
from the project root. This will give you development environment with elm
, so you can run:
elm reactor