Block Breaker is a classic arcade game where the player controls a paddle to bounce a ball toward bricks, aiming to break them all to win the game. The player loses if the ball falls below the paddle. With simple mechanics, this project is ideal for demonstrating basic game development principles in a structured, modular way.
-
Clone the repository:
git clone https://csgit.ucalgary.ca/shakil.hussain1/cpsc219groupproject.git
-
Set up JavaFX:
- If using an IDE like IntelliJ, configure JavaFX by adding the path to the
libfolder in your JavaFX SDK as a library. - In VM options, add the following, replacing
"path/to/javafx-sdk/lib"with the actual path to the JavaFX SDK:--module-path "path/to/javafx-sdk/lib" --add-modules javafx.controls,javafx.fxml
- If using an IDE like IntelliJ, configure JavaFX by adding the path to the
-
Compile and Run the Game:
- Open the project in your IDE.
- Run the main class
BlockBreakerGame.javalocated in thesrcdirectory.
Alternatively, from the command line, navigate to the
srcdirectory and run:javac --module-path "path/to/javafx-sdk/lib" --add-modules javafx.controls,javafx.fxml main/BlockBreakerGame.java java --module-path "path/to/javafx-sdk/lib" --add-modules javafx.controls,javafx.fxml main.BlockBreakerGame
The objective of Block Breaker is to destroy all the bricks on the screen by bouncing a ball off the paddle. The player controls the paddle at the bottom of the screen to prevent the ball from falling and to direct it toward the bricks. The game ends when all bricks are destroyed (win) or when the player runs out of lives (game over).
- Left Arrow / A Key: Move paddle left
- Right Arrow / D Key: Move paddle right
- P Key: Pause the game
- Escape Key: Exit the game
- BlockBreakerGame.java: Main class which runs the game
- StartMenu.java: Start screen
- MainGame.java: Main logic for game
- SettingsMenu.java: Settings for the game
- Leaderboard.java: Reads from csv file to get the top 10 scores
- WinScreen.java: Screen shown after you break all blocks and win
- GameOver.java: Game over screen shown after losing all lives
- PowerUp.java: Creates power ups
- TipsPage.java: Randomly cycled tips