Onboarding Project: Breakout Game, Part 2
This exercise is intended for you to practice creating active objects, with many small methods, in order to see how design affects your understanding of the code and how hard or easy it is to add new features to a program. It will not be explicitly graded but, instead, serve as a starting point for us to see your coding strengths and weaknesses (and how well you follow directions). Thus, you will get the most out of this assignment by putting in a good faith effort.
Submitting Your Work
Continue to work in your provided GIT repository, breakout_NETID
, hosted in the course's Gitlab group.
As your submission for this project, use GIT to add
, commit
, and push
the following:
src/main/java
folder: all project code
src/main/resources
folder: any images or block configuration files
- top-level (no separate folder): project README
Your code is expected to follow the course coding conventions and be reasonably commented (full Javadoc comments are encouraged but not required yet).
Specifications
Individually, continue to work on your game of Breakout, refactoring your existing code to improve its design while adding these new functionality features:
- Power-ups. Randomly, when destroyed, a brick will drop a power-up which, when caught by the player's paddle, affect the game in some way: 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
- Multiple Levels: At least three different levels, each of which has a different starting configuration of bricks
Read the configuration of bricks from a text file such that it is easy to see the expected pattern of the bricks (like this one, but the exact format is up to you).
- High Score: When the game ends (after the last level is completed or all the player's lives are lost), save the current score to a file (in sorted order) if it is one of the top 10 highest scores
- Splash Screen: It explains the rules of the game when the game starts and remains visible until the user clicks or presses a key to signal they are ready
- Status Display: Display indicators that are not part of the play area and show (at least): current level, how many lives the player has remaining, the current score, and the highest score achieved
- Cheat keys. In addition to the standard player controls, make cheat keys to help you debug your game (and us to play it :), including 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)
We strongly suggest you refactor the code, creating more methods and classes, before attempting to implement any of the new features.
GIT
This is a chance to practice using GIT more effectively on your own before working in a team, using many, small, purposeful commits with good commit messages rather than just one or two large "kitchen sink" or "submit-only" commits.
Design Goals
Practice the following mindsets about code to help you acclimate you to the course's overall Design Goals:
- consistent, both in formatting (following the course coding conventions which can be easily automated) and in things that cannot be automated like standard naming conventions (like using camelCase, proper types of speech, appropriate use of plurals, etc.)
- clean and readable, by refactoring at least twice after you have "finished" each feature (like making multiple drafts to get past the ugliness left over from all the things you tried just to "make it work")
- DRY, use parameters effectively or make general methods/classes that support multiple levels or other common things
Resources