How to create a checkpoint....

sebmacflysebmacfly Member Posts: 1,018
edited November -1 in Working with GS (Mac)
Hi there!

I'm wondering about to how to make a checkpoint...
For exemple, if i lost a live, i would like to restart the scene on the last checkpoint, without losting my items already taked (like coins or keys)

Thanks

Comments

  • HunnenkoenigHunnenkoenig Member Posts: 1,173
    Use an invisible actor for every checkpoint and save its coordinates and tell your camera, screen, actor whatever to start from that point again next time.

    Save your points, coins whatever in keys and load them after respawn.
  • sebmacflysebmacfly Member Posts: 1,018
    Thank you Hunnenkoenig!

    humm.... how i can save the last coordinates and tell the screen and camera to start from that point?
  • HunnenkoenigHunnenkoenig Member Posts: 1,173
    Make a game attribute for checkpoint X

    tell him, when overlaps with actor1 change attribute game.checkpointX to self.position.X (or you can add the coordinates manually so they are always constant)

    Then you have the coordinate for the checkpoint.

    tell the actor (or whatever you want to reset): when gamereset is true spawn actor at game.checkpointX

    I don't know what you want to do and what triggers what, but generally you should make yourself comfortable with self and game attributes and if-else commands, otherwise you can't do jack in GS.

    Everything is based on those things, so you will use them very VERY often :-)

    With my example you can get the picture.
  • sebmacflysebmacfly Member Posts: 1,018
    Thank you, i'll try that.... :)
Sign In or Register to comment.