Submarine Coin Collection

By Jon Amireh


My final graphics project is a coin collection and world exploration game. The scene is set near a shallow ocean floor and you play third-person as a submarine collecting coins randomly placed a certain distance away from you.


Spotlight - One of the main light sources is the spotlight that shines from the front of the submarine onto every object rendered

Animation - Both the camera's view and the submarine's model are animated on the same curve; that is, when the submarine turns so does the view and when the submarine levels out, so does the view using the exact same sin function

Particle Effects - There are around 15,000 particles in the world to mimic the dust and dirt particles that would be found in a scene like this

Collision Detection - When the submarine hits a coin, it uses smallest enclosing ball to calculate the bounding sphere and then a distance computation is performed to determine if the coin has been collided with the submarine.

Collision Reaction - When the submarine hits any of the 6 sides of the world, the velocity vector is projected perpendicuar to the side's normal which allows the submarine to glide across the side without passing through.

Texturing - The submarine and the sea floor have been textured with a single texture for a somewhat more realistic game.


W - Tilt down

A - Turn left

S - Tilt up

D - Turn right

SPACE - Pause throttle completely

O - Decrease throttle

P - Increase throttle

Win Condition and Coins

Collect all the coins (progress and initial amount can be found in terminal output) and then the program will quit itself.

The default coin count is 5; this can be customized with the first argument for the start of the program.

Known Issues

Controls can be a bit wonky; they can get stuck but the simple fix is if you get stuck, quickly press and release the directional key for the direction you're stuck and it should level out.

External Libraries