extends KinematicBody2D
export(int) var speed = 80.0
onready var animationplayer = $AnimationPlayer
func process(delta):
if Input.isactionpressed("uileft"):
_animationplayer.play("walkleft")
else:
animationplayer.stop()
func physicsprocess(delta):
var velocity = Vector2.ZERO
if Input.isactionpressed("uiright"):
velocity.x += 1.0
if Input.isactionpressed("uileft"):
velocity.x -= 1.0
if Input.isactionpressed("uidown"):
velocity.y += 1.0
if Input.isactionpressed("uiup"):
velocity.y -= 1.0
move_and_slide(velocity * speed)