ajout de la porte et équilibrage des mutations
This commit is contained in:
@@ -3,9 +3,14 @@ extends Interactable
|
||||
class_name Door
|
||||
|
||||
@export var to_scene_id = ""
|
||||
@export var icon : Texture : set = set_icon
|
||||
|
||||
func _ready():
|
||||
modulate = Color.WHITE if available else Color.RED
|
||||
if available:
|
||||
%AnimatedSprite2D.play("opened")
|
||||
else:
|
||||
%AnimatedSprite2D.play("closed")
|
||||
set_icon()
|
||||
|
||||
func interact(_p : Player) -> bool:
|
||||
if available and to_scene_id:
|
||||
@@ -16,4 +21,14 @@ func interact(_p : Player) -> bool:
|
||||
|
||||
func set_available(v : bool):
|
||||
available = v
|
||||
modulate = Color.WHITE if available else Color.RED
|
||||
if is_node_ready():
|
||||
if available:
|
||||
AudioManager.play_sfx("DoorOpen")
|
||||
%AnimatedSprite2D.play("open")
|
||||
else:
|
||||
%AnimatedSprite2D.play("close")
|
||||
|
||||
func set_icon(i: Texture = icon):
|
||||
icon = i
|
||||
if is_node_ready():
|
||||
%Icon.texture = icon
|
||||
|
||||
Reference in New Issue
Block a user