split gravity logic, various bug fixes

fixed gravity strength being possibly strong at level beginning
fixed restarting being allowed after getting the last ring
fixed save file's "played_for" being reset or set to another file's
fixed the displayed save file total play time not being updated on main menu

maybe there's other stuff
This commit is contained in:
Taevas 2025-04-29 21:18:04 +02:00
parent 38897c706a
commit 709ce8eea3
Signed by: Taevas
SSH key fingerprint: SHA256:Y5Hv18xwPvUKSlgkx1sPnRO3L2mc03ehC7BzrnZVEyY
11 changed files with 131 additions and 106 deletions

View file

@ -6,7 +6,7 @@ const names := [
"user://save_file_3.save",
]
var selected_file := names[0]
var selected_file: String
func _ready() -> void:
for save_file_name in names:
@ -22,6 +22,7 @@ func empty(save_file_name: String) -> void:
write(JSON.stringify({}), save_file_name)
func read(save_file_name: String) -> Variant:
print("Reading from save file ", save_file_name)
ensure_existence(save_file_name)
selected_file = save_file_name
@ -41,6 +42,7 @@ func write(json_string: String, save_file_name: String) -> void:
save_file.store_line("FOR YOUR SAFETY, ALWAYS CHECK IF THE DATA OF THE FILES YOU DOWNLOAD LOOKS OKAY")
func change_property(property: String, value, save_file_name: String) -> void:
print("Changing property '", property, "' on save file ", save_file_name)
ensure_existence(save_file_name)
var data = read(save_file_name)
data[property] = value