Ring Collector Ultra
Daniel Wiseman
CPE 471 with Professor Sueda

Overview

My project is a ring collector game in which the player tries to collect as many rings on the map as possible before the timer ticks to zero. Each ring collected adds onto the overall time and score depending on its value. Red rings, that are closest to the ground, are worth one point, green rings, which are the second highest rings, are worth two points, and purple rings, which are the highest off the ground, are worth five points. If the player is not challenged enough by the time limit then he/she can use the click menu to turn enemies on. These enemies will appear as black spheres and will follow the player until they collide with the player in which case the player will die ending the game. The higher the difficulty less rings are generated, you have less time, and there are more enemies which move at faster speeds. At the end of the game the player's final score will appear and whether or not you beat the high score.

How to Play

Implementation

Rings

To create the rings I randomly generate a shape object which contains the ring obj to draw a random, but ranged, translation, rotation, and scale on the ring. These rings are then added into a vector of rings. The color of a ring will be dependent on its height. When the player collides with a ring it will disappear and particles exploding outward of the same color of the rings will take its place. Additionally, the value of the ring will be added to the score and time. Ring collisions are based off of box collisions.

AI

To create the AI I translate every enemy towards the player by normalising the distance between their respective vectors. The enemy collision with the player is based off of whether or not the distance between the player's vector and the enemy's vector is less than or equal to the radius of the enemy's sphere. AI collision detection determines whether or not the distance between both the enemies' center is less than or equal to their radii, which is why I made them spheres.

Environment

For the environment I scale a square obj file to create the plane and then map a grass texture onto it which I scale for a repeating pattern. For the sky I scale a sphere and then map a blue sky texture then a cloud texture which translates every 60HZ onto the sphere. There's also a light which moves in a parabolic motion about the map and is used for Blinn-Phong shading which all of the rings contain.

Extra

Text displays on the screen which describes the amount of time left, the player's current score, and the amount of stamina the player has to sprint. The high score for the current player is kept in a textfile in the src directory which is read/write to every game in order to keep track of the highest score. There are boundaries on the map so the player cannot wander out of the sphere which are calculated by making sure the distance of the player from the origin does not exceed the radius of the sky sphere. When stamina exists and is used the player's translation will be increased. When it is not used and is not full it regenerates. Jumping is calculated by gradually incrementing/decrementing the y-value to a maximum/minimum. Finally, when the match ends the player cannot move and the high score text is displayed.

Images/Videos

Epic In-game Picture


Demonstration of Game (Particles are laggy because of video recording)

Extra

ApplicationServices used to counter the MAC glutWarpPointer issue.

References

  1. http://stackoverflow.com/questions/686353/c-random-float-number-generation
  2. http://creativecommons.org/licenses/by/3.0/
  3. http://stackoverflow.com/questions/2625021/game-enemy-move-towards-player
  4. http://stackoverflow.com/questions/14318/using-glut-bitmap-fonts