extends KinematicBody2D
var motion = Vector2()
var dir = -1
func ready():
pass
func _process(delta):
motion = moveand_slide(motion,Vector2.UP)
pass
func physicsprocess(delta):
motion.x = 50 * dir
$AnimationPlayer.play("move")
if isonwall():
dir *= -1
$Sprite.flip_h = $Sprite.flip_h
if is_on_floor() == false:
motion.y += 10
pass
func onhitboxbodyentered(body):
if body.isingroup("player"):
queue_free()
pass