Savegames!

This commit is contained in:
blinry 2021-01-07 11:36:11 +01:00
parent 76c4aab834
commit 5c1f1ce722
4 changed files with 20 additions and 8 deletions
scenes

View file

@ -143,6 +143,12 @@ func show_win_status(win_states):
level_description.hide()
level_congrats.show()
$SuccessSound.play()
if not game.state.has("solved_levels"):
game.state["solved_levels"] = []
var slug = levels.chapters[game.current_chapter].slug + "/" + level.slug
if not slug in game.state["solved_levels"]:
game.state["solved_levels"].push_back(slug)
game.save_state()
func repopulate_levels():
levels.reload()