L'arrivée de la boulangerie

Il n'y a rien dedans, mais elle est ouverte. Bonne visite
This commit is contained in:
Thomas
2025-03-30 14:38:20 +02:00
parent 9ecea272ab
commit a82237ff28
90 changed files with 21888 additions and 46 deletions

View File

@@ -1,13 +1,24 @@
extends Node
var _game : GameControler
var isUsingTouch = false
var hasChosenNotToMakeChoices = false
var hasChosenToMakeChoices = false
var hasCompletedBobDialogue = false
var playerIsDeaf = false
var hasMetBob = false
var hasVisitedBakery = false
var isPlayerDeaf = false
var current_scene = "outside"
var player_positions = Vector2(-171, -253)
var position_outside = Vector2(-171, -253)
var position_bakery = Vector2(461, 710)
func update_position(p: Vector2):
match current_scene:
"outside":
position_outside = p
"bakery":
position_bakery = p
func save():
var ret = {}
@@ -16,16 +27,25 @@ func save():
var propertyName: String = propertyInfo.name
var propertyValue = get(propertyName)
ret[propertyName] = JSON.stringify(propertyValue)
# don't save protected fields
if propertyName.begins_with("_") :
continue
return ret
func load_save(data:Dictionary):
isUsingTouch = data.isUsingTouch == "true"
hasChosenNotToMakeChoices = data.hasChosenNotToMakeChoices == "true"
hasChosenToMakeChoices = data.hasChosenToMakeChoices == "true"
hasCompletedBobDialogue = data.hasCompletedBobDialogue == "true"
playerIsDeaf = data.playerIsDeaf == "true"
current_scene = data.current_scene
var strplps = (data.player_positions as String).replace("\"(", "").replace(")\"", "")
var parts = strplps.split(", ")
player_positions = Vector2(float(parts[0]), float(parts[1]))
print(player_positions)
var thisScript: GDScript = get_script()
for propertyInfo in thisScript.get_script_property_list():
var propertyName: String = propertyInfo.name
# don't load protected fields
if propertyName.begins_with("_") :
continue
if data.get(propertyName) == null:
continue
if propertyName.begins_with("is") or propertyName.begins_with("has"):
set(propertyName, data.get(propertyName) == "true")
elif propertyName.begins_with("position_"):
var strplps = (data.get(propertyName) as String).replace("\"(", "").replace(")\"", "")
var parts = strplps.split(", ")
set(propertyName, Vector2(float(parts[0]), float(parts[1])))
else:
set(propertyName, data.get(propertyName).lstrip("\"").rstrip("\""))