Added lever animation

This commit is contained in:
2026-03-17 21:56:31 +03:00
parent 489c89e1ac
commit 8ec34e1285
4 changed files with 86 additions and 14 deletions
@@ -5,8 +5,7 @@ extends Node2D
@onready var hint_sprite : Sprite2D = $HintSprite
func activate() -> void:
pass
var _player_in_range := false
func _ready() -> void:
@@ -16,10 +15,16 @@ func _ready() -> void:
func _on_body_entered(body: Node2D) -> void:
if body is Player:
hint_sprite.show()
body.interacted.connect(activate)
_player_in_range = true
body.interacted.connect(_activate)
func _on_body_exited(body: Node2D) -> void:
if body is Player:
hint_sprite.hide()
body.interacted.disconnect(activate)
_player_in_range = false
body.interacted.disconnect(_activate)
func _activate() -> void:
pass