init
This commit is contained in:
13
player/scripts/push_area.gd
Normal file
13
player/scripts/push_area.gd
Normal file
@@ -0,0 +1,13 @@
|
||||
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
|
||||
Reference in New Issue
Block a user