A save point
By the end your game will save when the player touches a flag, and offer a Carry on button on the welcome level next time.
What you need
Saving rules are Advanced. Switch to Advanced mode.
| A welcome level | A first level called Welcome with a Button called Play (words Play). |
|---|---|
| Carry on button | A second Button called Carry on with words Carry on. Untick Visible when the level starts. |
| Save flag | + Add object โ Library โ Flag. Name it Save point. Put one in each level, part-way through. |
| Saved text | A Text saying Saved! with Visible when the level starts unticked. |
| Sound | Power up. |
Build it
- On Welcome, open the Events tab. + New event โ ๐ฌ Game โ There is a saved game. In Carry on choose Show.
- + New event โ Play โ Button is clicked โ Next level.
- + New event โ Carry on โ Button is clicked. In ๐ฌ Game choose Carry on from the saved game.
- Go to a game level. + New event โ Hero โ Collides with another object โ Save point.
- In ๐ฌ Game choose Save the game. Show the Saved text and Flash (blink) it for 2 seconds. Play Power up. Then Destroy the Save point, so it only saves once.
- At the very end of the game, add Forget the saved game to the winning rule. Next time starts fresh.
- Press โถโถ Play game. Touch a flag, press Esc, and play again. The Carry on button is there.
WhenThere is a saved game
DoShow Carry on
WhenCarry on is clicked
DoCarry on from the saved game
WhenHero collides with Save point
DoSave the gameShow Saved!Saved! flashes for 2 secondsPlay sound Power upDestroy Save point
What gets saved
Save the game remembers the level, the score, the lives and the global values. It does not remember where every sprite was. Carry on from the saved game starts that level again from its beginning, with the saved score and lives.
Make it yours
- Save automatically: use Start of level โ Save the game on every level, and skip the flags.
- A Forget the saved game button on the welcome level for a clean start.
- Keep a collected key between levels: store it in a Global value, which is saved too.