bonkjj st!
This commit is contained in:
parent
dd66cc2a84
commit
7d20cb9bcc
4 changed files with 38 additions and 6 deletions
|
|
@ -16,3 +16,8 @@ func _physics_process(delta: float) -> void:
|
|||
velocity += global_position.direction_to(player.global_position) * force * delta
|
||||
velocity -= velocity * damping * delta
|
||||
move_and_slide()
|
||||
|
||||
|
||||
func _on_hitbox_body_entered(body: Node2D) -> void:
|
||||
if body.has_method(&"knock"):
|
||||
body.knock(global_position.direction_to(body.global_position) * velocity.length())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue