crabs-game/scripts/Globals.gd

23 lines
529 B
GDScript3
Raw Normal View History

2020-08-20 14:45:54 +02:00
extends Node
var ui_accept_tip = false
var ui_interact_flatfish_tip = false
2020-08-20 17:45:40 +02:00
var did_already_play_once = false
2020-08-20 18:52:24 +02:00
func save_game():
var file = File.new()
file.open('user://globals.save', File.WRITE)
file.store_line('1' if did_already_play_once else '0')
file.close()
print('saved')
func load_game():
var file = File.new()
if not file.file_exists("user://savegame.save"):
return
file.open('user://globals.save', File.READ)
var d = file.get_line()
did_already_play_once = true if d == '1' else false
print('loaded')