**This is an old revision of the document!**
Table of Contents
Platformer Tutorial, Part 7: Add Checkpoints to the Game
Step 1: Create an object for the checkpoint
- Create a Sprite object named “Checkpoint”.
- Add an image to the object that represents the checkpoint.
- Drag one or more instances of the object into the scene.
Step 2: Save the player's coordinates when they collide with the checkpoint
- Create a new event.
- Create a Collision condition that checks if the “Player” object has collided with the “Checkpoint” object.
- Create a Value of a scene variable action that creates a “CheckpointX” variable with a value of
Checkpoint.X()
. - 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
- Find the event that checks if the “Player” object is colliding with the “Slime” object.
- Remove the Delete an object action from the event.
- Create a Change the position of an object action that changes the X and Y coordinates of the “Player” object to
CheckpointX
andCheckpointY
.