HeartBeast/assets/Enemies/Bat.gd
2021-04-04 19:20:44 +02:00

11 lines
261 B
GDScript

extends KinematicBody2D
var knockback = Vector2.ZERO
func _physics_process(delta):
knockback = knockback.move_toward(Vector2.ZERO,200*delta)
knockback = move_and_slide(knockback)
func _on_Hurtbox_area_entered(area):
knockback = area.knockbackvector * 120