That method refers to saving your last checkpoint closing your game, and playing it from that last checkpoint. Is that what you wanted?
This method is the checkpoint system, with a save/load addition. If the checkpoint is a flag, then
Player->Collision (Disable Repeat)->Script Editor
- Code: Select all
checkpoint++;
This will mark how many checkpoints you have passed, note that if you are able to repeat checkpoints than you would want to do it in a similar fashion as this
Player->Collision (Disable Repeat)->Script Editor
- Code: Select all
if (collide.cloneindex==checkpoint)
{
checkpoint++;
}
This way ensures that checkpoint goes up only if it is the next checkpoint. The flaw would be if you skip a checkpoint... To fix that, you can use this method
Player->Collision (Disable Repeat)->Script Editor
- Code: Select all
checkpoint=collide.cloneindex;
This now remembers whichever checkpoint you last hit.
Now when you need to move back to that checkpoint, let's say when you die, then you would need to create the actor in the correct spot. One way is to send an activation event to the checkpoint flags, and that will cause the right one to create your actor. I personally would create a die variable, and in the draw actor of the checkpoints, they have
Flag->DrawActor->Script Editor
- Code: Select all
if (die==1 && cloneindex==checkpoint)
{
//Create Actor
die=0;
}
On the destroy actor, you would want to set die equal to zero, probably with a timer, otherwise the effect would be immediate. In most cases that is not preferred.
For the save/load, I would need to find a demo for you, but a good thing to read if you are ever wondering about a function's use
http://game-editor.com/docs/script_reference.htmJust search for the saveVars and loadVars functions. They are pretty self explanatory, but you must make sure they are in a save group when creating the variable.
I changed the method from above, but both will work. Use whichever you feel is best. Not sure if this answered your question...