Lab 04 - Platformer Game
This assignment is to create a simple platformer game. Your game should consist of the following at a minimum:
- A sprite that can move left, move right, and jump.
- A series of surfaces "platforms" that your sprite can stand on.
- If your sprite is not standing atop a surface, gravity should pull your sprite down.
- When your sprite jumps, it should do so with momentum. (e.g. if you are moving to the right and jump, your sprite should arc upwards and to the right until it reaches the peak of its jump, then it should fall in the same direction).
Hints
-
You'll need to use collision detection to determine if your sprite is on top of a platform. Don't forget to take the sprite's height into account so that their feet land on the platform, not their head or torso.
-
Concept from your momentum / inertia code from the spaceship assignment will come in handy here.
Grading
Out of 100 points:
Architecture (50 Points)
0 Points - Code doesn't compile
10 Points - Everything is in main.
25 Points - There's a Sprite class, a Platform class and a vector or list of Platform objects.
30 Points - There's a game, Sprite, and Platform class, but main is still doing too much.
50 Points - The main function just initializes the Game class and starts the game loop. The Game class has multiple functions for each part of the game loop, and the Sprite class is properly architected.
Features (50) Points:
0 Points - Code doesn't compile
10 Points - The sprite appears and moves left and right.
20 Points - The sprite can move left and right and jump.
35 Points - The sprite can move left and right, jump with momentum, and fall.
50 Points - The sprite can move left and right, jump with momentum, fall, and land on platforms.
Submission:
- Navigate to the folder containing your source code.
- Create a zip file of your entire project.
- Upload that zip file to mySVU.