The goal of this project was to create a simple space shooter game. I love Star Wars and was thrilled when I found a free OBJ file of the Millennium Falcon. After completing each task, I kept thinking of more and more things that I wanted to add. I'm proud of my final project but look forward to working on it more.
The main features I implemented were:
w: Toggle speed boost Space: Start or restart game
f: Fire weapon Escape: Quit game
b: Barrel roll
The biggest challenge I had was getting collision detection to work smoothly and properly. The method of collision detection I used was sphere-to-sphere collision detection. I did this because it was (supposed to be) easy to implement in the time I had to complete the project. What I did was "draw" a sphere around the Millennium Falcon and a sphere around every asteroid depending on its size. I then checked if the distance between the center of the ship and the center each asteroid was less than the sum of their radii. If it was, then I registered it as a collision. This method worked well for the asteroids, but the Millennium Falcon is not as spherical so its possible to register a collision above the ship when there shouldn't have been. In order to register fewer false-positives, I decreased the size of the spheres around the Millennium Falcon and the asteroids. In the future, I want to "draw" an axis-aligned bounding box around the Millennium Falcon and use that for collision detection.
Another challenge I had was getting the explosion effect to display properly. I was testing the effect in a previous lab we did for the class and it was working perfectly. However, when I tried to bring it into my final project, nothing was drawing on the screen! I thought that was ridiculous and I almost pulled my hair out trying to figure out what was wrong. In the end, I was using two different variable names for my alpha texture in my main.cpp and my fragment shader.
I still want to add text to the top left or right corners of the screen to says how many asteroids the user has destroyed, how fast the ship is moving, and how many lives the player has before the game is over. Next, I want to add sound to the game. I want to add John Williams' classic Star Wars main theme along with sound effects for when the player shoots or crashes. Finally, I want to work on geometry instancing to display the asteroids.