crabs-game/scripts/Globals.gd
2020-08-20 18:52:24 +02:00

23 lines
529 B
GDScript

extends Node
var ui_accept_tip = false
var ui_interact_flatfish_tip = false
var did_already_play_once = false
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')