Project Overview:
My partner Igho and I chose to work on a project that required creating 3D pool game using VPython. VPython is an easy to use open source software that includes python programming language and 3D module.
Project requirements:
- Create a pool table with at least 2 balls
- Manage collisions between balls and walls
- Apply some rules
- Handle controls
- Create user friendly interface
Project's future:
Creating a cue stick in this game would help users to aim better and make the game look more sophisticated. Moreover, we could make a path line between cue ball and target ball to make aiming easier. This game also needs more rules, tables and levels in order to meet users' needs.
Another big feature that we would add to this game in future is for a computer player to play against humans. Though it might take time and a lot of effort to accomplish this part of the game, it is very important and a generally required feature for games like 3D Pool.
Game Guide:
How to play the game:
To launch the game you will need VIDLE installed on your computer. From VIDLE, browse to the game file, open and then run the file. A window with text 'PLAY' launches for the player to click and start the game. The player places the cursor behind the cue ball to obtain a direction which is normal to were the ball is intended to move to. With a right mouse click the ball moves. A left mouse click and movement helps to rotate the board. Use keys 1 to 9 to control the power of shots.
Some of the rules:
- Whenever the cue ball drops in the holes, the ball resets and the other players gets the turn to play.
- The game ends when a player successfully pots 3balls.
Game Features:
- “Play” button – we included this button to start the game. It opens a window with a pool table with balls at their start position.
- Hit Power – Using keyboard's number keys users can change the power of the hit. If this function is not used power takes default value, which is constant number given in the program.
- Hitting the ball – hitting the ball is possible by clicking mouse's left button, while cursor is behind the cue ball.
- Player change – if cue ball falls in hole players exchange turns.
- 3 balls rule – any player gets 3 or more balls in holes that player wins.
- “Winner is...” text – game announces a winner by showing a text message projected on x,y surface.