Jump to content

How to implement a checkpoint?


black_c
 Share

Recommended Posts

I'd make a Checkpoint class and a CheckpointStore class, then whenever the player passes through a checkpoint in the game make a new Checkpoint and put it in the CheckpointStore. When the player falls in to a trap and dies, ask the CheckpointStore for the last saved Checkpoint and restore the player and gamestate to what's saved in that Checkpoint. 

Obviously there is a lot more detail necessary for this approach, but that's a high level way to look at it. 

(Also the term "store" here I'm using by the definition of "a place to keep something" rather than "a place to buy something")

Link to comment
Share on other sites

It seems like you should take a look at Phaser's documentation and some of its examples. There's a level of fundamentals that you need to understand in Phaser before you're going to have any success with it.

Something like finding a players' coordinates can be looked up in the documentation or the examples, and looking that up yourself will build your skills in both Phaser and finding the answers to your Phaser questions.

I'm not trying to discourage you from asking questions on the forum - the Checkpoint question was a fantastic one! There's all kinds of ways to implement it and there's a great discussion to be had in the forums about it. But when it comes to the basics of Phaser or any library or framework really, you're better off attempting to look up the documentation or googling around to answer your question first rather than asking for help too soon. 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...