CS106A Assignment #3 Breakout

screen

This is the first big assignment / program that I have worked on. And it was a blast doing it completely on my own. The only thing I had  to refer to google for, was where to place the addMouseListener().

Here is the link to the assignment – http://see.stanford.edu/materials/icspmcs106a/19-assignment-3-breakout.pdf

The biggest challenge was to manage the size of the program and decomposing it effectively. I have done my best but I’m sure there are better ways to implement all this. If anyone reading this has better solutions then please comment below.

Most of the strategies used are explained in the comments of the code. Some comments are simpler as the code itself is easily readable (at least I hope it is :D).

I did all the hard work of working out the game’s mechanics on paper first. Then, I dived into eclipse and coded for about an hour, slowly realizing that the ideas that work on paper do not translate directly to the actual code because I forget a lot of little things. For example, I forgot to add the brick separation while setting up the bricks. But nothing that “game-breaking”.

I have also added most of the extensions mentioned in the assignment including messages, sound, kicker and keeping score. I want to add another layer of increasing the difficulty by making bricks descend down the canvas slowly as the game progresses. I think it can be implemented by making the bricks a single GCompound subclass and then using the move() method. I shall implement it at a later date.

For now, I’m moving onto the next section.

Here is the gist github link for the code – Breakout