Assignment 5: Godzilla vs the Lag Monster

Eric Abbott-Brenner (cs184-ab)
David Youngworth (cs184-bw)

For homework 5, we decided to extend our Godzilla scene into a very primitive game in which you take control of Godzilla and destroy the city.

In order to do this, we implemented the following additional features:
1. A simple particle system. This was used for Godzilla's fire breath and explosions effects. The particles are implemented as colored quads with an alpha channel texture. They are all stored together in a vertex array so that they won't slow things down too much.
2. A basic combat system. It works as follows:
- Godzilla and the tanks both shoot projectiles.
- Tanks have two types of projectiles, one reduces the player's score, the other reduces the player's score and shrinks godzilla.
- Tanks will swivel their turret to face godzilla, and fire a shot with some random variation in his direction.
- Godzilla has firebreath that will damage tanks and buildings upon collision. When a vehicle or building has no health remaining, it explodes.
- Godzilla can step on vehicles when he is big. This instantly explodes them.
- Trucks and helicopters are unarmed.
- Godzilla uses w, a, s, and d to move, the mouse to aim(it's a little hard), and the left mouse button to fire.
3. A basic collision detection system. It uses bounding boxes for the detection and callbacks to a collision function to apply the effects. Collisions are checked between projectiles and all non-projectile objects as well as between godzilla and all non-projectile objects. Godzilla is the only non-projectile object that moves. Note:
- If Godzilla collides with a building he stops.
- If Godzilla collides with a vehicle and he is large, the vehicle is destroyed. If he is small, he stops.
- The collision detection is used to determine projectile hits and the callback applies the appropriate gameplay effect(dealing damage, reducing score, etc).
- The drive in theater is the ghost of godzilla past. As such nothing collides with it.
4. Texture filtering and an improved texture loader. We modified the image loader to run off of a library called SOIL. This was necessary to get alpha channels working properly and it can autogenerate mipmaps(we took advantage of this and turned on mipmapping).
5. Miscellaneous features:
- Vehicles are randomly spawned on the roads.
- Buildings now have separate roof textures and are randomly textured for both roof and side.
- A basic scoring system has been implemented(yes it's supposed to be able to go negative).
- Nearly everything in the scene can be blown up.
- Godzilla is invincible and the game only ends when he says it does. As such, the game only ends when you hit the x button in the upper right corner.

Here is a screenshot demonstrating the above:

And here is a demonstration video:
Demonstration Video

And here is the executable and source code:
Executable
Source

Here is the executable for assignment 3 if you'd like to compare the two:
As3 Executable

There are a number of bugs that we did not get around to fixing(occasionally strange collision detection behavior for example). They are all fairly minor bugs and we don't consider them to be gamebreaking.