0 votes

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?

in Engine by (22 points)

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

1 Answer

0 votes

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!

by (810 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.

Categories