Get help using GDevApp.
User avatar
By Lizard-13
#66577 When you collide with a checkpoint, deactivate the previous one and activate the new one with an object variable:
Code: Select allConditions: Player collides with Checkpoint
Actions: No actions

        // Deactivate all the checkpoints
        Conditions: Take into account all Checkpoint
        Actions: Do = 0 to variable "active" of Checkpoint

        // Activate the new Checkpoint
        Conditions: No conditions
        Actions: Do = 1 to variable "active" of Checkpoint


Then when you are dead, select the active Checkpoint and go for its location:
Code: Select allCondition: Player collides with Enemy
           Variable "active" of Checkpoint is = 1
Actions: Do - 1 to variable "lives" of Player
         Do = Checkpoint.X() ; = Checkpoint.Y() to the position of Player
By Lance Harrison
#68321 I've been having problems with it recognizing additional to checkpoints.
I think I did what you described above but it's still not working.
Please take a look and help me understand where I'm going wrong, thank you.
Attachments
Screen Shot 2018-10-01 at 14.37.13.png
Screen Shot 2018-10-01 at 14.37.13.png (52.33 KiB) Viewed 661 times
User avatar
By Lizard-13
#68325 Well, if you use the Linked Objects extension there is no need to use the "active" variable. When you collide with a checkpoint break all the previous link and link the player with this colliding checkpoint only. Then when you want to go back to the checkpoint just take into account the checkpoint linked to the player and move to its position.

Not tested but should look like this:
Checkpoint.png
Checkpoint.png (10.99 KiB) Viewed 651 times