extends Sprite

var right = 90
var left = 270
var down = 180
var up = 0

var d:float = 0.0
var radius:float = 47.0
var speed:float = 1 

const SPEED = 6

var velocity = Vector3(0,0,0)

#func _process(delta: float) -> void:
#	d += delta 
#	var p:Vector2 = Vector2(
#		sin(d * speed) * radius, 
#		cos(d * speed) * radius
#	) + Vector2(150,250)
#	var angle := p.angle_to_point(position)
#	$Sprite.rotation(angle)
#	position = p 
func _ready():
	pass



func _physics_process(_delta):
	if Input.is_action_pressed("ui_right") and Input.is_action_pressed("ui_left"):
		velocity.x = 0
		
	elif Input.is_action_pressed("ui_right"):
		velocity.x = SPEED
	elif Input.is_action_pressed("ui_left"):
		velocity.x = -SPEED
	else:
		velocity.x = 0
	
	if Input.is_action_pressed("ui_up") and Input.is_action_pressed("ui_down"):
		velocity.z = 0
	
	elif Input.is_action_pressed("ui_up"):
		velocity.z = -SPEED
	elif Input.is_action_pressed("ui_down"):
		velocity.z = SPEED
	else:
		velocity.z = 0
