CompSci 308
Fall 2019
Advanced Software Design and Implementation

Build a Breakout Game

If children can build, play and understand games that work, it's possible that someday they will understand and design systems that work. And the world is full of complicated systems. — Sara Corbett

Back in the 1980s, video arcade games were in their prime. Local restaurants, pubs, and arcades lured customers with all of the latest titles: Pac-man, Galaxian, Donkey Kong, Tempest, Centipede, Defender, and more. (Un)fortunately, the rise of home video game systems and home computers relegated these gems to the back storage rooms of many establishments (although tiny and big versions seem to be making a comeback). They are not forgotten, however — even today, arcade cabinets are collected by enthusiasts and arcade ROM emulation systems such as MAME allow a new generation to experience these relics first-hand on modern hardware (including, briefly, the iPad).

Breakout is a popular extension to the first cabinet arcade game, Pong, that was designed by Steve Jobs and Steve Wozniak, the founders of Apple, Inc. It was such a big hit that, to this day, it is still spawning additional game spin-offs in the form of the game Arkanoid. These games build on the basic premise of Breakout, clearing a field of bricks, but add elements of every other game imaginable. You can play a version online or watch a (long) video of the original gameplay and here is playlist of dozens of variants of the original game.

Simple versions of this game have been used as a programming assignment in CompSci 101 and more generally as an assignment that is highly regarded by educators as "nifty", but part of its continuing appeal is how easily the game supports complex variants, such as:

Specifications

Write a Java program, using OpenJFX, to play a 2D game of Breakout, in which a ball bounces around the screen and affects bricks as it bounces into them. The player controls a paddle to brick the ball from moving off the screen. 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. If the player misses blocking the ball too many times, the game should end and display a message that the player lost. If all the bricks are cleared from the screen, the level should end and a new one loaded (with a different configuration of bricks). If the player clears all the levels, the game ends with a message that declares the player won.

You are welcome to look at the tutorial in the Resources below or any other ones you find online to learn about OpenJFX, but your game should be distinctly different from any given examples you find (i.e., create your own Breakout game, do not simply copy one). Your game does not need to be the greatest variant created, or even have sophisticated graphics, but it should include multiple levels, each with multiple "kinds" of bricks and power ups.

While some basic code will be discussed in class, it is expected you will learn most of the details by reading online examples and documentation.

Design

The heart of a game is its conceptual Game Loop because it manages the entire game logic from responding to input, to updating the state of the game items, to enforcing the game's rules, to checking if the game's goals are met, to potentially much more. Although it is not a literal loop in OpenJFX, which uses a TimeLine to call your code periodically, it is called a loop because it is responsible for managing the game actions repeatedly, many times per second, until the user quits. Each iteration, or frame, of the game loop is called on between 60 up to 120 times (frames per second, FPS). Game loops are typically organized around Update Methods to make it easier to add new elements — in very complex games, the game loop is factored out into a separate Game Engine so new games can be written by focusing just on the new code specific its characters, rules, and goals without modifying the Engine's game loop itself (there are many popular engines like Unity or Unreal (made in NC!)).

You are not expected to write an actual Game Engine for this project, but it does provide a context to begin thinking about issues of design and coding style.

Project Goals

This project is intended as a warm-up to introduce you to

Deliverables

You will submit this project in stages:

Resources