Mikye1
10-18-2011, 12:32 AM
you will implement a video game as described below. You are allowed to implement extra features, as long as you provide sufficient documentation in your README file of how to play the game (Provide a README file with your submission even if you do not add any extra features.)
We will think of the game as taking place in three dimensional space, but the graphics will be drawn in the plane. We have a set of objects, called things. Each thing is drawn as a colored square on the (x,y) plane (but you may design the things however you like). The things move around within a large square window with constant speed. Whenever a thing hits the side of the square it bounces off, while maintaining its speed. For example, if it hits a vertical wall, then the y-component of its velocity is unchanged and the x-component is negated. Initially the things start with random locations and random velocities.
Each thing floats on a certain level, which can be thought of as its z-coordinate. There are 5 different levels for z = 0, 1, 2, 3, 4. Each level contains 4 things initially. There is also one additional level z = 5 called the ground level. On levels 0, 1, 2, live the good things (drawn in yellow) and on levels 3 and 4 live the evil things (drawn in purple).
The objective of the game is to destroy all the evil things (for which you gain points) while destroying as few good things as possible (for which you lose points). To tell differences in level, the darker colors are for lower levels. Things that are at the same level have the same color.
You destroy things by dropping bombs on them. This is done by clicking the left mouse button at the position that you want the bomb to start. A bomb starts at level 0, and slowly falls to each of the other levels until it hits the ground level, where it disappears. A bomb is drawn as a smaller square (or any design that you may have). To indicate the present level of the bomb, its color changes (to match the color of the level) as it falls. When a bomb at level i hits a thing that lives at level i (meaning their squares overlap) the thing is hit and changes color to black to indicate this. About a second later, the thing disappears (meaning that it is destroyed). After a bomb hits a thing, the bomb continues to fall. Score and other status information should be written onto the screen.
The game is terminated either when the user press the ’q’ key, or when all the evil things are destroyed. The game can be paused by pressing the middle mouse button, and the game can be single-stepped by pressing the right mouse button.
We will think of the game as taking place in three dimensional space, but the graphics will be drawn in the plane. We have a set of objects, called things. Each thing is drawn as a colored square on the (x,y) plane (but you may design the things however you like). The things move around within a large square window with constant speed. Whenever a thing hits the side of the square it bounces off, while maintaining its speed. For example, if it hits a vertical wall, then the y-component of its velocity is unchanged and the x-component is negated. Initially the things start with random locations and random velocities.
Each thing floats on a certain level, which can be thought of as its z-coordinate. There are 5 different levels for z = 0, 1, 2, 3, 4. Each level contains 4 things initially. There is also one additional level z = 5 called the ground level. On levels 0, 1, 2, live the good things (drawn in yellow) and on levels 3 and 4 live the evil things (drawn in purple).
The objective of the game is to destroy all the evil things (for which you gain points) while destroying as few good things as possible (for which you lose points). To tell differences in level, the darker colors are for lower levels. Things that are at the same level have the same color.
You destroy things by dropping bombs on them. This is done by clicking the left mouse button at the position that you want the bomb to start. A bomb starts at level 0, and slowly falls to each of the other levels until it hits the ground level, where it disappears. A bomb is drawn as a smaller square (or any design that you may have). To indicate the present level of the bomb, its color changes (to match the color of the level) as it falls. When a bomb at level i hits a thing that lives at level i (meaning their squares overlap) the thing is hit and changes color to black to indicate this. About a second later, the thing disappears (meaning that it is destroyed). After a bomb hits a thing, the bomb continues to fall. Score and other status information should be written onto the screen.
The game is terminated either when the user press the ’q’ key, or when all the evil things are destroyed. The game can be paused by pressing the middle mouse button, and the game can be single-stepped by pressing the right mouse button.