I started this program with the idea to make a fun and simple 3D game that showcased some of the things that I learned in CPE 471.

The Game

  • "Robot Rush" is a 3rd person game where the objective is to avoid the enemies in order to get a high score. The game excels in giving the player a variety of enemies, having simple controls, and having fun gameplay style.

  • Features

    1. Collision Detection

           The collision detection in this 3D game is quite unique. Instead of using a 3D test for a collision like a point in polygon test, I use a 2D collision detection technique in combonation with a Z-axis test.

    I use the Separating Axis Theorem to check if the objects have collided in the X and Y coordinates. The theorem states that if 2 convex objects are not colliding, then there must be some axis to which each object are on opposing sides.

           The only axis you need to test are the ones that are parrallel to each edge of each object. In my case, I used only rectangles, which meant there were 4 total to check.

    You then get the normal to each axis, project the points of each object onto that axis, and then see if the mins/maxs are overlapping. If they are not, then the objects are not colliding.

           I would do this X & Y check only if the thickness of the player (robot) and the thickness of the object, are overlapping in the Z-axis. I was able to do this hack because the player is always constantly moving in the Z direction.

    2. Hierarchical Modeling

           I have many models in my game that the player must avoid. Many of them move and spin to add challenge to the game.

    3. Gameplay Features


  • All enemies are randomized in many different ways: location, speed, size, etc.

  • Whenever you hit one of the enemies, you lose a life. When you are all out of lives, the game is over, however there are many extra lives scattered throughout the game to enable continued play.

  • There are 3 main levels in the game, a graveyard, a forest, and a room filled with deadly obstacles. Once you have passed all 3 levels, the game puts you back to the first level with obstacles re-randomized and a speed increase. If you can handle the speed, the game will never end!

  • The game's movement is calibrated based on time, so that no matter what machine the game is running on, it will always play at the same rate.

  • There is a HUD that keeps track of your score (your distance) and how many lives you have.

  • Whenever you get an extra life or get hit by an obstacle, there is a notification on the screen for clear feedback.

  • A brief tutorial at the beginning that explains the rules to the player.

  • Arguments

    To play, make and then enter "run".

  • You can play the game with no arguments, it will be set to default values (Speed: 1.0 and Lives: 10).
  • The first argument is the speed.
  • The second argument is the number of lives.
  • To skip the tutorial, just have any thing else after the last argument, ex: "run 1.2 25 a".
  • Controls

  • A to move left

  • D to move right

  • Spacebar to jump

  • P to pause

  • Q to quit