Hello guys,
This is my first attempt to create a game in python via the package vpython. It is a billard game (8-ball pool) where you can play against a friend.
It's not perfect yet, but gives a good insight into mathematical and physical challenges of programming a billard game.
I hope the script can be helpful for others.
Have fun browsing the code and playing.
Installing and running:
-
Install vpython package:
conda install -c vpython vpython or pip install vpython
-
clone repository:
git clone git://github.com/Szuendo/billard-adventure.git
-
run Main.py (in ../billard-adventure/billard_simulation):
cd billard-adventure/billard_simulation
python Main.py
Mouse:
- Clicking 'set kickoffdir' enables aiming by moving the mouse.
- Clicking 'set kickoffvel' enables increasing/decreasing shot power by moving the mouse.
Keys:
- 'D': Allows the cueball to be played after a shot power is specified. (after the shot power is specified wait 3 seconds before clicking 'D' to play the cueball)
Credits:
-
A. Herschach, Entwicklung eines virtuellen Billardspiels, Institut für Computervisualisierung Universität Koblenz/Landau , Koblenz 2007 (german) https://kola.opus.hbz-nrw.de/opus45-kola/frontdoor/deliver/index/docId/128/file/Ausarbeitung.pdf
-
Package - Vpython: https://vpython.org/