This is a simple single-player Billard game implemented in JavaFX. The game allows you to play with 15 colored balls and a white cue ball on a pool table.
To run this JavaFX project, you need to have the following installed:
- Java Development Kit (JDK) 8 or above
- JavaFX SDK
- Clone the repository to your local machine or download the source code.
git clone <https://github.com/TCExpert/Billiard.git>
-
Make sure you have JavaFX properly installed and set up on your system.
-
Open the project in your preferred Java IDE (e.g., Eclipse, IntelliJ, Visual Studio).
-
Set up the JavaFX libraries in your IDE. Depending on your IDE, the steps may vary. Here are some general instructions:
-
Eclipse:
- Right-click on the project folder and select "Properties."
- Go to "Java Build Path" and click on the "Libraries" tab.
- Click on "Add Library" and select "User Library."
- Click on "User Libraries" and then "New" to create a new library.
- Name the library "JavaFX" (or any name you prefer) and click "OK."
- Select the newly created library and click on "Add External JARs."
- Browse to the location where you have JavaFX installed and select all the JAR files in the "lib" folder.
- Click "Apply and Close" to save the changes.
-
IntelliJ IDEA:
- Go to "File" -> "Project Structure."
- Under "Platform Settings," select "Global Libraries."
- Click on the "+" icon to add a new library.
- Choose "Java" and browse to the location where you have JavaFX installed.
- Select all the JAR files in the "lib" folder and click "OK" to add them.
- Once the project and JavaFX libraries are set up, you can run the game by executing the
Start.java
file.
- Use the mouse to control the cue stick and aim for the target ball.
- The further away the mouse is from the ball, the stronger the shot.
- Release the mouse button to strike the cue ball and hit the target ball.
- The objective is to pocket all the colored balls on the table using the white cue ball.
Enjoy playing the Billiard game!
This project is licensed under the MIT License.