Creating checkpoints

allc1865allc1865 Member, PRO Posts: 777
So how would you create a checkpoint so that way in case your character gets destroyed, the game resets back to your checkpoint? Thanks

Answers

  • zweg25zweg25 Member Posts: 738
    there are many ways you can make checkpoints. I believe you can have a character spawner and an attribute called "checkpoint number", then you can have an invisible actor at your checkpoints. Then when your main character overlaps with your invisible checkpoint actor change attribute "checkpoint number" = "checkpoint number" + 1.

    Then in your character spawner you can do two things:

    1) create a rule that says if checkpoint number == 1 spawn actor here, if checkpoint number == 2 spawn actor here etc.

    2) Create a table that has columns as checkpoint number. Rows as level number (if you have levels) and x or y values as the input value. (If you need a specific x AND y value you can use row 1 for x and row 2 for y). Then in your character spawner put spawn main character at tableCellValue(Table 1, level number (or just row 1 for x and then row 2 for y), checkpoint number)
    Also you can have your invisible checkpoint actor have a rule that says when overlaps or collides with main character change attribute self.position.X to (Table 1, level number, (checkpoint number + 1))

    Hope thats not to confusing and it helps
    zweg25
Sign In or Register to comment.