Lab 05 Part 1. Program a Side-scrolling Platform Game

Objectives:

  • Part 1
    • Write code to handle mouse down event, so that the character flies up upon mouse down
    • Write code to handle key down event, so that pressing LEFT or RIGHT arrow keys moves the platforms, the spinning coin, and the "?" box
    • Write code to handle frame event, so that some statements will be executed constantly at frame rate
    • Write code for collision detection using hitTestPoint()
    • Write code to model gravity effect on the character

How the Completed File Works:

Same as the pre-lab plus the following:

  • The character falls with the gravity effect and will lands on the platform.
  • The platforms can now continuously scroll.
  • Add a variable increx and use it as the increment for moving platforms, coin, and box upon arrow key presses.