Save and Load level on quitting (also checkpoints)
Beaneh912
Member Posts: 6
Hi there,
I'm so stuck with this and its very frustrating but how can I save the game and load it back to the same position if someone was to close the app.
I know i have to use save and load attributes or a table but I dont understand how to use either of them, can someone please help me.
Also I'm guessing that the same sort of technique is used to set checkpoints in a game, im doing a platform game and i want to set a checkpoint in the middle of the level so that the character can respawn there if it dies instead of restarting the whole scene, but yet again i am at a loss.
Thank you
Jake
Comments
Someone must know surely?
make a new table called X and Y positions add two columns, name them
X and Y
put a rule in your checkpoint actor, if player overlaps with a checkpoint change table value game.tablexandY
row 1 col 1 to self position X
row 1 col 2 to self position Y
add two new real attributes to your player actor named stored X and stored Y
change attribute self.stored X to tableCellValue(tableXandYpositions,1,1)
and
change attribute self.stored Y to tableCellValue(tableXandYpositions,1,2)
then add a rule
if self stored X is equal or greater then 0
change self.position X to self.stored X
change self.position Y to self.stored Y
Hope that helps.
I'm making a step by step on how to make a platformer as well, you can check out the videos here