load custom artwork

This commit is contained in:
Fabien Freling 2020-06-10 17:15:33 +02:00
parent 8cc55513b7
commit 5e1e27b2cb
10 changed files with 225 additions and 47 deletions

View file

@ -8,7 +8,8 @@ var _first_popup_call := true
func _ready():
taquin.rect_min_size = get_viewport().get_visible_rect().size * (2.0 / 3.0)
layout_reflow()
load_game()
if not load_game():
start_fresh()
print("Starting state: ", taquin.current_state_name())
func _notification(what):
@ -56,7 +57,7 @@ func save_game():
func load_game():
var save_game = File.new()
if not save_game.file_exists("user://savegame.save"):
return # Error! We don't have a save to load.
return false # Error! We don't have a save to load.
# Load the file line by line and process that dictionary to restore
# the object it represents.
@ -68,11 +69,16 @@ func load_game():
# Call the node's save function
var node = get_node(node_data["path"])
if node != null:
node.call("load", node_data)
if node.call("load", node_data) == false:
return false
else:
print("Cannot load node ", node_data["path"])
save_game.close()
return true
func start_fresh():
taquin.start_fresh()
#
# Signals