**This is an old revision of the document!**

Platformer Tutorial, Part 7: Add Checkpoints to the Game

Step 1: Create an object for the checkpoint

  1. Create a object named “Checkpoint”.
  2. Add an image to the object that represents the checkpoint.
  3. Drag one or more instances of the object into the scene.

Step 2: Save the player's coordinates when they collide with the checkpoint

  1. Create an event with a Collision condition that checks if the “Player” object has collided with the “Checkpoint” object.
  2. Add the Value of a scene variable action to the event. Use the action to create a “CheckpointX” variable with a value of Checkpoint.X().
  3. Add another Value of a scene variable action to the event. Use the action to create a “CheckpointY” variable with a value of Checkpoint.Y().

Step 3: Send the player to the saved coordinates when they die

  1. Remove the Delete an object action from the event that checks if the “Player” object is colliding with the “Slime” object.
  2. Add a Change the position of an object action to the event. Use the action to change the X and Y coordinates of the “Player” object to CheckpointX and CheckpointY.

Step 4: Set the player's default coordinates

(Optional) Step 5: Fix the positioning of the player