Files
aarpg/interactables/dungeon/scripts/pushable_statue.gd
Andriy Yednarovych e877c5f058 init
2026-02-22 19:26:26 +01:00

19 lines
454 B
GDScript

class_name PushableStatute extends RigidBody2D
@onready var audio: AudioStreamPlayer2D = $AudioStreamPlayer2D
@export var push_speed := 30.0
var push_direction := Vector2.ZERO :
set = set_push
func _physics_process(_delta: float) -> void:
linear_velocity = push_direction * push_speed
func set_push(new_push_direction: Vector2) -> void:
push_direction = new_push_direction
if push_direction == Vector2.ZERO:
audio.stop()
else:
audio.play()