Break Out

For this assignment you will modify your pong program from lab to make the game Break Out. For those that do not know the game, Break Out is a game similar to Pong that consists of a user controlled paddle and a ball bouncing around the screen. Break Out also includes bricks (rectangles) at the opposite side of the screen as the paddle. When the ball bounces off of the bricks they disappear. The player wins the game by making all of the bricks disappear.


Setup

Create a directory assignment3 under assignments in your cs170 directory. All code for the assignment should be stored in this directory.

cd ~/cs170/assignments
mkdir assignment3
cd assignment3

Details

The paddle should be on the bottom of the screen and only able to move laterally. There should be enough bricks to arrange them in a pattern at the top of the window. After the ball bounces off a brick, the brick should disappear. That is it should no longer be drawn and should no longer be checked for intersection with the ball. When all of the bricks have disappeared the program should display a congratulatory message.

You are required to have two different types of bricks. One brick is a standard brick as described above; They break and disappear after being struck once. Another type of brick you are required to have are strong bricks, which take multiple hits to break.

Note that the collision detection method covered in pong does not specify how to determine which side of a brick the ball collides with. A simple solution to this problem is to make the bricks wide but not very tall and to assume that all collisions are with either the top or bottom of the brick. Also note that that the collision detection method from lab can not determine which brick is hit first, if the ball is intersecting with multiple bricks. This can be a problem because if the ball does intersect with two bricks the result will be to change the velocity twice, and the ball will not bounce. A simple solution to this problem is to arrange the bricks so that it is not possible for the ball to intersect with multiple bricks simultaneously.


Progress Report

This assignment is a bit bigger than the first two this semester. For that reason, together with there being a test next Friday, you have two whole weeks to complete this assignment. You need to manage your time carefully, so that you can complete the entirety of the assignment.

As such, I am requiring a "Progress Report" turned in by next Friday, February 7th. You should turn in what you have done by Friday, so I may give you back comments.

The only requirement for the Progress Report is that you must submit a working version of Pong. If you already have a working version of Pong, you should submit what you have done so far for Brick Breaker. If you don't have a working version of Pong, you should definitely finish that by Friday.

This is worth 10 points of your assignment grade. It does not sound like a lot, but they should be 10 easy points to get each week. Do not neglect them.


Submission

You are required to submit a tar file to http://cseval.roanoke.edu/. On cseval, there is a link for Assignment 3. You can create a tar file by issuing the following commands:

cd ~/cs170/assignments
tar czvf assignment3.tgz assignment3/

"Hacker" Prompt

  1. Better Collisions: The collisions you are using now are likely very erratic. You can easily enter not only the side of the bricks, but also the side of the paddle. A better mechanism would alter how the ball behaves depending on where it collides with the bricks and paddles.

  2. Precision Bounces: Another slight issue with the ball bouncing physics is that the angle of the ball never changes. A very good break out player usually changes the angle of the ball, to allow for the greatest score possible on each bounce. And easy way to accomplish this is by changing the angle depending on where the ball hits the paddle or the brick. A better way would be to incorporate the speed of the paddle into your computations, allowing the user to put a "spin" on the ball.

  3. Levels: After the player destroys all of the bricks on the screen, restart the game with a new, more difficult arrangement of bricks. You should develop a sane way to represent levels, so that you don't hard code the levels into your game.

  4. Bonuses: Add bricks that when hit modify the game play to make it easier for the player. For example, maybe a brick will slow down the ball, add extra balls, etc. To make it more fun, the bonuses can fall from the destroyed brick and only be awarded if they intersect with the paddle.


Last modified: Fri Jan 31 11:45:31 EST 2014