Alien Invasion

Overview

You are a lone fighter pilot that has been deployed to the sea in response to suspicious activity that has been reported by local vessels. Despite the stormy weather currently happening, you go on a patrol path to investigate the cause of these reports. On arrival, you find nothing suspicious when suddenly a large force field is extended around you, trapping you in. On top of this, a group of UFO's start to warp in and open fire on your ship. Unsure whether or not you'll survive this surprise ambush, you have no choice, but to fight the UFO's and shoot as many of them down as possible before you go down yourself.

Controls

W: Go up
S: Go down
A: Turn Left
D: Turn Right
Space: Fire bullets
I: Reduce speed
O: Increase Speed

Goal

The goal of the game is fairly simple. As the fighter, you know you're about to die, so your objective is to eliminate as many of the UFO's as possible before you are destroyed. The player has 50 health points, and the player is killed when either the health is lost or the player runs into an environmental boundary. Each UFO you destroy will earn the player 400 points. This score is reset to 0 every time the player is destroyed in the encounter.

Environment

Environment with perlin

The environment around the player is composed of 6 cubes, each of which is colored by the perlin noise function that adjusts with time. The bottom is the water of the sea, the top is the clouds above the player, and the sides are the force field that the aliens have used to trap the player. Originally the walls were all to be a purplish color, however, since the CSL computers did not have the noise function avaliable, I have colored them different colors so that the player can tell where they are in the arena.

Enemies

The enemies in this game are UFOs that will spawn in throughout the game. The spawning of the UFOs is entirely random within the bounding box. The UFOs are spawned with a texture of the green bronze from the statue of liberty wrapped around it. Throughout the game, they will be moving to different positions in the arena. The UFOs will pick another point in the arena to go to and will move to that point in straight line increments.

When the game starts, ten enemies will spawn in immediately and more will continue to spawn thoughout the duration of the game. A max of thirty enemies can be in the arena at the same time. Each enemy is spawned in with 30 health (the player's bullets do 10 damage) and will attempt to fire at the player with spheres (each do 10 damage). The spheres will attempt to track the player and follow them around until their time limit runs out and they disappear.

Hit Collision

Most of the collisions in the game are strictly box box collision. The player and crashing into the environment the player and the collision possible with the other enemies are both using box box collision. When the player hits the environment, they are destroyed and when the player runs into a UFO, the UFO and the player are both destroyed. The bullets of the player and the UFOs both use line box collision detection and box box collision detection to see if they have hit a target. If enought bullets hit the player or the UFO, it will be destroyed. When the player is destroyed, particles will come out of the player where they died, indicating to the player that they have died.

The bounding box is created during the creation of the shape from the object file. When the scaling of the object is occuring, it will grab the minimum and maximum points of the box and create a bounding box based on those. This box will scale and move with the object, but will not rotate with the object.