Best way to setup a level select scene? and save question.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Kavi
:warning: Old Version Published before Godot 3 was released.

I know how to save a score and high score etc, and I was just wondering what I would use to save something like a level, and what the best way to set up a level select screen etc. I know how to save a variable number but would it be the same for something like a completed level? Like how when you unlock a new level and it no longer has a lock on it, how would I save that if I used a dictionary?

Any suggestions?

Did you get a solution to your question? I’m facing the same thing (new to Godot).

Paul Masri-Stone | 2019-06-20 14:49

:bust_in_silhouette: Reply From: Robster

Interesting, I’m facing the same questions. Here’s my rough plan.

It depends what your level is, but for me, mine will be dynamically created by loading data from an XML or JSON file. I’m currently scratching my head over this.

Another option may be to create a whole level as a scene. Simply save the scene as say, Level01.tscn, load it up and get it moving with your code (depending on what your game is).

RE a level select screen, you could simply have say a bunch of texturebuttons. Each one linking to their corresponding scene. Knowing which level the player is at, you could have again, a saved file. The file could literally have the scene numbers, if they’re unlocked or not. If unlocked, allow the texturebutton to be pressed for that level. If not, don’t allow it.

RE: how to save in a dictionary. I’ll try and come back here. I’m REALLY having a fight with XML, JSON, Dictionaries and files right now. Once I’ve won that fight though I’ll be sure to report back.

Good luck and have fun with it!