How to Save the Player Settings with ConfigFile (Godot tutorial)

GDQuest
GDQuest
22.5 هزار بار بازدید - 7 سال پیش - Learn how to save game
Learn how to save game data to the disc using the config file system.
Make Professional 2d Games (Kickstarter): https://gdquest.mavenseed.com/courses
----
Download the start project (example 12 in the start folder): https://github.com/GDQuest/Godot-30-d...

Godot has 2 features that make it easy for you to serialize data, thus write and load save games. One is the ConfigFile class, that creates INI style outputs. This is the same class that is used to generate and read the config.cfg file in every Godot project. These files have an easy to read, linear structure, with sections and key-value pairs.
It works well for simple games, where you have but a handful of variables to store. But also if you want to store the core datatypes from Godot: ConfigFile can store and retrieve variables of type Color, Vector2, Matrix32... Due to its simplicity, it’s often the preferred format for user-defined game settings.
Then, there is JSON, which we can get convert to and from a dictionary. We will see that in tomorrow’s tutorial.

Daily tutorials series! 22/30
The playlist: Godot 2.1 Tutorials
Project sources on Github: https://github.com/GDQuest/Godot-30-d...

This tutorial is supported by:
Gamblify: https://www.gamblify.com/
Pineapple Works: http://pineapple.works/

Subscribe to the channel now and become a member of the community! https://www.seevid.ir/c/Gdquest?sub_con...

Follow GDQuest on:
Twitter: Twitter: NathanGDquest

This video is licensed under the CC-By 4.0 license: https://creativecommons.org/licenses/...

You can attribute it to "GDQuest and contributors - https://www.gdquest.com/"
7 سال پیش در تاریخ 1396/03/25 منتشر شده است.
22,585 بـار بازدید شده
... بیشتر