INQ241B
Mobile Apps

Activity 11

Obstacles

In this activity you will create a platform game. To do so, complete the following steps:

  1. Create a sprite that falls due to gravity, that jumps when the user presses a keyboard key, and that moves left and right when the arrow keys are pressed.

  2. Use a for loop to create many random obstacles that the player controlled sprite can jump on.

  3. End the game if the player sprite falls off of the screen.

  4. Create a sprite set of goal sprites, each at random location on the screen. When the player sprite overlaps with a goal sprite, increase the score and delete the sprite.

  5. Display a congratulatory message if the player collects all of the goal sprites. Use the score variable to determine if the user has collected all of the sprites. Use the game->spash function to display the message.

Submission

Please show your source code and run your scripts for the instructor or lab assistant.