fix: fixed the sceneEntrance to the dungeoun and back; fixed the opened chest state after switching scenes;
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -843,6 +843,7 @@ position = Vector2(-79, -19)
|
||||
|
||||
[node name="SceneEntrance" parent="." unique_id=1734357035 instance=ExtResource("5_oi8ly")]
|
||||
position = Vector2(137, -107)
|
||||
collision_mask = 1
|
||||
|
||||
[node name="LockedDoor" parent="." unique_id=964088255 instance=ExtResource("6_elpgg")]
|
||||
position = Vector2(137, -107)
|
||||
|
||||
@@ -14,7 +14,7 @@ func _process(delta: float) -> void:
|
||||
|
||||
func _on_body_entered(body: Player) -> void:
|
||||
print("body entered!")
|
||||
$"/root/SceneManager".player_next_scene_spawn_pos = player_spawn_pos
|
||||
SceneManager.player_next_scene_spawn_pos = player_spawn_pos
|
||||
get_tree().change_scene_to_file.call_deferred(next_scene)
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ func _ready() -> void:
|
||||
scroll_number = randi_range(1, 4)
|
||||
if SceneManager.opened_chests.has(name):
|
||||
is_open = true
|
||||
$AnimatedSprite2D.play("open")
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if Input.is_action_just_pressed("Interact") and can_interact:
|
||||
@@ -16,12 +17,9 @@ func _process(delta: float) -> void:
|
||||
$Timer.start()
|
||||
$AudioStreamPlayer.play()
|
||||
$AnimatedSprite2D.play("open")
|
||||
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)
|
||||
scrolls[scroll_number].visible = false
|
||||
|
||||
Reference in New Issue
Block a user