Skip to content

ShakH00/BlockBreaker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Block Breaker Game

Overview

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.

Table of Contents

Project Setup

  1. Clone the repository:

    git clone https://csgit.ucalgary.ca/shakil.hussain1/cpsc219groupproject.git
  2. Set up JavaFX:

    • If using an IDE like IntelliJ, configure JavaFX by adding the path to the lib folder 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
  3. Compile and Run the Game:

    • Open the project in your IDE.
    • Run the main class BlockBreakerGame.java located in the src directory.

    Alternatively, from the command line, navigate to the src directory 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

Game Objective

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).

Game Controls

  • Left Arrow / A Key: Move paddle left
  • Right Arrow / D Key: Move paddle right
  • P Key: Pause the game
  • Escape Key: Exit the game

Project Structure

  • 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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages