diff --git a/src/Save/save_settings.gd b/src/Save/save_settings.gd new file mode 100644 index 0000000..7202e0b --- /dev/null +++ b/src/Save/save_settings.gd @@ -0,0 +1,30 @@ +extends Node + +const SETTINGS_FILE = "GameSettings.save" + +var game_data: = {} + +func _ready() -> void: + load_data() + +func load_data(): + var file: = File.new() + + if not file.file_exists(SETTINGS_FILE): + game_data = { + "fullscreen": false, + "vsync": false, + "particle_effects": true, + "master_vol": -10 + } + save_data() + + file.open(SETTINGS_FILE, File.READ) + game_data = file.get_var() + file.close() + +func save_data(): + var file: = File.new() + file.open(SETTINGS_FILE, File.WRITE) + file.store_var(game_data) + file.close()