Bouncing-Ball-Game-JavaFX

Bouncing Ball Game with JavaFX

Table of Contents

Overview

The Bouncing Ball game is a simple, interactive JavaFX application where a ball bounces around the screen. Users can control the speed of the ball using the up and down arrow keys. The game demonstrates the use of JavaFX animation and event handling capabilities.

How to Play

  1. Start the Game: Run the application to start the game. The ball will start bouncing around the screen.
  2. Objective: Reach the number of bounces required to win the game without the ball going too fast.
  3. Control the Ball Speed: Use the UP and DOWN arrow keys to increase or decrease the ball speed, respectively.
  4. Win or Lose: If the ball reaches the required number of bounces without exceeding the maximum speed, you win. Otherwise, you lose.
  5. Play Again: After winning or losing, you can play the game again by clicking the “Play Again” button.

User Interface

Welcome Screen

Bouncing Ball Game Welcome Screen

Game Interface

Bouncing Ball Game Interface

Win Screen

Bouncing Ball Game Win Screen

Lose Screen

Bouncing Ball Game Lose Screen

Features

Prerequisites

Setup and Installation

  1. Download JavaFX SDK: Download the JavaFX SDK from the OpenJFX website and extract it to a known location on your machine.
  2. Clone the Repository: Clone this repository to your local machine using git clone https://github.com/hoangsonww/Space-Invader-Game-JavaFX.git.
  3. Open the Project: Open the project in your Java IDE (e.g., IntelliJ IDEA).
  4. Configure JavaFX SDK: Configure the JavaFX SDK in your IDE by adding it as a library to the project.
  5. Run the Application: Run the application using the IDE or Maven commands.

Configuration

Before running the application, ensure that JavaFX is properly configured in your IDE (e.g., IntelliJ IDEA, Eclipse):

Running the Application

To run the application, navigate to the src/com/example/bouncingballgamejavafx directory and compile the BouncingBall.java file. Then, execute the main method within the BouncingBall class.

Ensure that the JavaFX SDK is properly configured in your IDE before running the application.

Alternatively, you can run the application using the following Maven command:

mvn clean javafx:run

Contributing

Contributions to the Bouncing Ball game are welcome. Please feel free to fork the repository, make your changes, and submit a pull request.

License

This project is licensed under the MIT license. See LICENSE for more details.

Author


Created with ❤️ by Son Nguyen in 2024.