**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 Sprite 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 a new event.
  2. Create a Collision condition that checks if the “Player” object has collided with the “Checkpoint” object.
  3. Create a Value of a scene variable action that creates a “CheckpointX” variable with a value of Checkpoint.X().
  4. Create a Value of a scene variable action that creates a “CheckpointY” variable with a value of Checkpoint.Y().

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

  1. Find the event that checks if the “Player” object is colliding with the “Slime” object.
  2. Remove the Delete an object action from the event.
  3. Create a Change the position of an object action that changes 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