Complex systems can be viewed either by focusing upon things or processes; there are compelling reasons for applying object-oriented decomposition, in which we view the world as a meaningful collection of objects that collaborate to achieve some higher level behavior. — Grady Booch
Game : Implementation
Build the Breakout game you planned using multiple classes and code you feel is clean and readable. While creating your code for this project, we expect your design to follow this checklist as well as the specific goals described in the assignment. Your Gitlab repository should show many small purposeful commits rather than just one or two large "kitchen sink" commits.
Note, basic comments and the project README (especially the cheat keys you created) must also be completed with this submission.
Specification
Create a basic Java implementation, using OpenJFX, of the project that meets at least these functional requirements:
- Game Interaction: Allow the player to control a paddle to block the ball from moving off the screen using either the mouse or keys.
- Game Rules: The ball bounces around the screen and off bricks, destroying them in the process. The ball may bounce off of some sides of the screen; however, if the ball moves off a specific area of the screen (typically the bottom), the player loses a life and the ball is reset to its starting position.
Occasionally a power-up is created when a brick is destroyed, "falls" and, when caught by the paddle, helps the player in some way (like lengthening the paddle, slowing down the ball, or creating multiple balls).
- Game Goals: The game should end, and display an appropriate message, based on two conditions:
- New Level: If all the bricks are cleared from the screen
- Win: If the last level is completed
- Loss: If the player misses blocking the ball too many times
- Splash Screen: It explains the rules of the game at start up. It should stay visible until the user clicks or presses a key to signal they are ready to start the game.
- Status Display: Display indicators that are not part of the play area and show (at least) how many lives the player has remaining, and a score.
- Level Configuration: At least three different levels, each of which has a different starting configuration of bricks. Read the configuration of bricks from a text file, whose format is up to your team, but it must be possible to easily compare the expected pattern of the bricks in both the text file and running program (like this one). Additionally, the game should get harder in some way the more levels you survive. For example, increasing the ball's speed, decreasing the paddle's size, or placing the bricks closer to the bottom.
- Bricks. At least three different kinds of bricks. The typical brick is cleared after one hit, but some bricks may take multiple hits, may give out power-ups, or may be worth extra points or whatever else you dream up for them to do. If some bricks are permanent features, they should not be counted when deciding to end the level.
- Paddle. Give the paddle at least three different abilities. These can be activated/deactivated in any way you want: per level, per power-up, per score, etc. Some common paddle abilities include making the ball bounce differently depending on where it hits (i.e., the middle third cause the ball to bounce normally, the left and right thirds cause the ball to bounce back in the direction it came), "catching" the ball when it hits the paddle and releasing it at a later time when a key is pressed, speeding up the longer it moves in the same direction, or warping from one side of the screen to the other when it reaches the edge.
- Power-ups. At least three different kinds of power-ups. Some bricks drop power-ups when they are destroyed which, when caught by the player's paddle, affect the game in various ways: making the paddle longer, speeding up the ball, giving the player extra bouncing balls to use to clear bricks, giving the player lasers with which to destroy bricks, giving the player a way to escape the level, or almost anything else you can think of.
- Cheat keys. In addition to the standard player controls, make cheat keys to help you debug your game and the course staff to play it :). Include at least the following (here are tons of ideas for cheat codes):
- 'L': add additional lives to the player
- 'R': resets the ball and paddle to their starting position
- '1-9': when the player presses a numeric key, clear the current level and jump to the level corresponding to the number pressed (or the highest one that exists)
- Something Extra. Once you have the basic game working, add at least one substantial "extra" feature to make your game more interesting. It can be directly from one of the example variants above or something you make up.