Checkpoints between layouts

  • So I have checkpoints at different layouts/Different rooms.

    How I am trying to make it work:

    Have a checkpoint at the first layout which you can check. Die at the second layout and return to the checked checkpoint. I want to be able to set checkpoints between layouts and be able to go back and forth to check them and die at different spots. (You know like in Knytt Stories)

    In the How do I FAQ there were some explanation for checkpoints within the same layout but not between different ones. I would like to figure out how to do so with the least hassle and most flexibility.

    Thanks!

  • Create a sprite as your checkpoint. Store all the pertinent information on layout, etc... in instance variable. When the player reaches the checkpoint take the values from the checkpoint sprite and put them in global variables. Whenever a user dies have it use the information from the global variables (layout name, etc...) to start the player where you want them.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thanks for the reply, BluePhaze.

    Oh my god... I just noticed:

    There are "Save/Load game" actions.

    They seem to work perfectly.

  • Just remember that the save and load is for the whole state of the game. You can get yourself into odd situations depending on where you save. For example if you give the player options for disabling and enabling music, etc... and you save those settings, then the next time they load they will be where they were when they saved that setting. I tend to put a on load goto layout on there, then I can always send them back to the level select screen, etc... when they load the game. In your case that may not be needed, just be careful where you are calling the save game action.

    Also any info that happened since the last save will be lost when you load.

  • BluePhaze,

    An easy way to overcome 'odd situtations' when saving and loading is by using a sprite, set it to global and then use instance variables and also use the 'no save' behaviour. Then use the event 'on load complete' set instance variable x to global variable y.

    If the user toggles the sound on and off, loading or saving will have no effect as the value is stored in the global sprite .

  • Or you can use web storage local values

  • federer365 when you load you lose all current values though. Items that have no save selected would revert to their default settings. Unless I am mistaken.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)