14 lines
355 B
GDScript
14 lines
355 B
GDScript
extends Area2D
|
|
|
|
func _ready() -> void:
|
|
body_entered.connect(on_body_entered)
|
|
body_exited.connect(on_body_exited)
|
|
|
|
func on_body_entered(body: Node2D) -> void:
|
|
if body is PushableStatute:
|
|
body.push_direction = PlayerManager.player.direction
|
|
|
|
func on_body_exited(body: Node2D) -> void:
|
|
if body is PushableStatute:
|
|
body.push_direction = Vector2.ZERO
|