Pre-lab 05: Start a Side-scrolling Platform Game

Objectives:

  • Write code to handle mouse down event, so that the character flies up up on mouse down
  • Write code to handle key down event, so that pressing LEFT or RIGHT arrow keys moves the two copies of platforms, the spinning coin, and the "?" box
  • Write code to handle frame event, so that some statements will be executed constantly at frame rate

How the Completed File Works:

  • Mouse down to make the character go up. It will keep going up and up. It's OK as the pre-lab. Later we will add gravity to pull it down on the ground.
  • LEFT and RIGHT arrow keys to move the platforms, the spinning coin, and the "?" box. You will encounter the ends of the platforms. It's OK. Later we will program continuous scrolling.