feat: add persistence to the opened chest via SceneManager opened_chests array;

This commit is contained in:
2026-09-20 16:29:17 +02:00
parent 8a4a440ad9
commit e789ea0717
2 changed files with 5 additions and 9 deletions
+4
View File
@@ -7,6 +7,8 @@ var scroll_number = 0
func _ready() -> void:
scroll_number = randi_range(1, 4)
if SceneManager.opened_chests.has(name):
is_open = true
func _process(delta: float) -> void:
if Input.is_action_just_pressed("Interact") and can_interact:
@@ -17,6 +19,8 @@ func _process(delta: float) -> void:
print("found sprite num: ", scroll_number)
scrolls[scroll_number].visible = true
is_open = true
SceneManager.opened_chests.append(name)
print(SceneManager.opened_chests)
func _on_timer_timeout() -> void:
print("removing sprite: ", scroll_number)