CS 0447 – Project 2: Kaboom!
Due: Sunday, July 8, 2012
He is ashamed to admit it, but the first video game system your professor played as a small child was the Atari 2600. His favorite game was Kaboom! by Activision, a game in which you caught falling bombs dropped by the nefarious “Mad Bomber” in water buckets.
In his opinion, the catch a falling object in a container genre peaked with Kaboom! In this project, you will recreate a simple version of the game in MIPS.
After your first project, you might be wondering how to get MARS to make something as awesome as a video game. For this, we can thank several graduate students and Dr. Childers for a modified version of MARS that contains a LED display which we can control. The display is an array of pixels (64 x 64) and each LED can be one of 4 colors: off (black), red, green, or yellow/orange.
In later courses, we’ll discuss two strategies for talking to I/O devices from machine instructions. In this case, the pixel display is memory-mapped. This means that a byte in our address space is reserved for each pixel, and that the content of that array is reflected in the output of our display. Learning about the memory-mapped I/O is not the core of the project and so we provide get and set methods for manipulating a pixel at a specified location.
Additionally, the LED display has support for a key pad. It can handle either button presses on the dialog box or you can use the keys on your keyboard (WASD).
You will need to download this special modified version of MARS from the class webpage in order to do this project.
When you wish to use it, go into the tools menu and select “Keypad and LED Display Simulator”. In the window that appears, click “Connect to MIPS”. Then run the program in MARS using the green play button.
The mad bomber lives in row Y=1 (2nd row) of our display, in the center at X=31. He is a yellow/orange LED which starts moving a random number of pixels to the right when the center button is pressed. Along the way, he drops bombs which fall from row Y=1 towards the bottom of the screen without a change in the X position (they fall straight down). When he reaches as far right as he will go, he reverses direction and randomly moves an amount of spaces to the left, again dropping bombs periodically.
Our hero is a line of 8 green pixels at row Y=62, also initially centered in the display. The line moves one pixel left or right when the corresponding key is pressed. If the green line catches a falling bomb (that is, the position of the bomb when it is at row Y=63 is one of the green pixels of the line), the score is incremented.
Mad bomber Falling bomb
If the line misses a bomb, the game resets, and the hero’s bucket is
reduced to 6 pixels. A second miss means 4 pixels. A third miss ends the game,
and the final score is displayed via the print string syscall.
Hero’s bucket of water
Figure 1: Kaboom! on the LED Display in MARS
The bombs initially will fall one pixel every 300 ms. After every 16 successfully caught, the time will decrease by 50ms.
The game goes on until lost.
When you are done, create a zip file containing your MIPS code and upload it through the class submission website at http://www.cs.pitt.edu/~jmisurda/submit