extends KinematicBody2D

var velocity = Vector2.ZERO

func _physics_process(delta):
	if Input.is_action_pressed("game_down"):
		velocity.y += 2
	if Input.is_action_pressed("game_up"):
		velocity.y -= 2
	if Input.is_action_pressed("game_left"):
		velocity.x -= 2
	if Input.is_action_pressed("game_right"):
		velocity.x += 2
	velocity = velocity.clamped(4)
	move_and_slide(velocity*10)
