Use global sounds system in end door
This commit is contained in:
parent
ba3306c04c
commit
af4bece554
3 changed files with 16 additions and 14 deletions
|
@ -1,18 +1,13 @@
|
|||
extends Node2D
|
||||
|
||||
@export var next_map:PackedScene
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
pass # Replace with function body.
|
||||
signal door_entered()
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
pass
|
||||
@export var next_map: PackedScene
|
||||
|
||||
|
||||
func _on_area_2d_body_entered(body: Node2D) -> void:
|
||||
func _on_player_detector_body_entered(body: Node2D) -> void:
|
||||
if body is Player:
|
||||
door_entered.emit()
|
||||
SceneManager.current_scene = next_map.instantiate()
|
||||
SceneManager.win_sound.play()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue