Save Coins Across Checkpoints?

In my game: Roll n' Bounce! (Pc Port) - Flowlab Game Creator

There is a checkpoint object and was wondering how you would do a coin save system with the checkpoints? But only if you have the checkpoints enabled? So when you respawn you keep whatever amount of coins you had until you touched the checkpoint. But if you had checkpoints disabled (from main menu) you wouldn’t keep the coins you would restart normally, and you can’t carry those coins over different levels.

If you go into the game. level select- (enable Checkpoints) - ToyBox - level 1

the only sprites are ‘1AA Player Ball’. (when you enter it’s behaviors just move up a tiny bit and you will find bundles. One labeled Checkpoints

and the other sprite is titled ‘Checkpoint’

A huge thanks to JR01 with the checkpoints across multiple levels: Checkpoint Example - Flowlab Game Creator

1 Like

So there are multiple things that needs to work on top of this.

  1. You need a save for the coins you collect
  2. The system needs to only work when interacting with checkpoints
  3. The coins need to remember that they have been collected or not

Also you didn’t really explain it well but I think I understand after looking at the code.
So firstly you need to save the coins you collect. Lets add onto the checkpoint code, so the new coins collected save resets when the player is on a different level. We’ll also add a new number list global that will have the checkbox to update all globals with the same name.

Next, we’ll reuse the other checkpoint bundle to save the coins we collected so far after getting a checkpoint. I added a mailboxes that will need to be used from the coin.

And finally, the coins we collect need to remember they were collected. We’ll add the Coin ID message so the player sees what coin it collects. For the coin to remember it was deleted, use the global in step one that will check the list to check if the ID in the global matches its own ID. If they do match, the coin will delete itself.

1 Like

It all nearly works! I appreciate your help. There is only one slight issue and am curious if you may know how to fix the coin counter. The ‘flag barrier’ sprite should destroy when reaching 4 coins, but if you collect 2 coins and then fail and re spawn at a checkpoint the 2 coins are not saved for that sprite to read and then destroy. Do you know a solution for this?

Have noticed one final issue is that because the checkpoint flag uses a on hit event there is an issue that during the run when you have re-spawned it starts a new save for the coins re-spawning. So if you collected a coin at the start of a level, you find the checkpoint maybe grab another coin later, when you re-spawn after. Those two coins are indeed gone but because you collide with the checkpoint again as you re-spawn. those two coins are back because the checkpoint starts a new save for the coins you collect per life, is there a way to make this work universally just while you play per level. All the coins are saved but when you finish the level. the coins revert so when playing the level again later for whatever reason you can still collect the coins all over again?