Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Game #18

Merged
merged 57 commits into from
Aug 10, 2021
Merged

Game #18

merged 57 commits into from
Aug 10, 2021

Conversation

ekiefl
Copy link
Owner

@ekiefl ekiefl commented Aug 10, 2021

This PR takes pooltool from an interactive simulation to a full game.

games module added

pooltool is no longer an interactive simulation, it can also facilitate single and multiplayer (offline) games, such as 8-ball, 9-ball, etc. Rules for a game are defined in the pooltool.games module.

Options menu now functional

The user can now choose which game they want to play, the table dimensions, ball dimensions, coefficients of friction, etc from the options menu

New modes:

To meet the requirements of certain games, which require the ability to call shots, move the ball with your hand, cue different balls, etc., I have added several necessary game modes:

  • New mode for deciding which ball to cue (PickBallMode). Controls: hold 'q' to choose ball, click to confirm
  • New mode for ball in hand (BallInHandMode). Controls: hold 'g' to choose ball, click to confirm, mouse to move ball, click to finalize placement
  • New mode to call your shot (CallShotMode). Controls: hold 'c' to choose ball, click to confirm, mouse mouse to choose pocket, click to confirm
  • New modes for saving and loading camera states. To save, hold '1' and release mouse over save spot. To load, hold '2' and release mouse over save spot.

Interface vs ShotViewer vs Play

There used to be 1 class that managed the interactive interface. Now there is a superclass Interface, and two subclasses ShotViewer and Play. ShotViewer enables the interactive viewing of a shot that is calculated offscreen in a script (for example, see sandbox/looseness.py), whereas Play creates a game environment with menus, a HUD, shot-taking controls, etc. This is a huge milestone, as pooltool can now be used by billiards researchers for fine-tuned programmatic control of shot simulations.

ekiefl added 30 commits July 5, 2021 19:24
can determine whether or not a shot is legal (push-outs not implemented)
code in upwards of 6 places for each mode added. Now, I only need to
create the mode.py file and have ModeManager inherit it.
@ekiefl ekiefl merged commit 4a9eae5 into master Aug 10, 2021
@ekiefl ekiefl deleted the game branch August 10, 2021 22:51
This was referenced Aug 11, 2021
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.

None yet

1 participant