Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
290 B
86
Indexable
Never
extends KinematicBody2D

var speed = 300
var velocity = Vector2()


func _physics_process(delta):
	velocity = Vector2()
	if Input.is_key_pressed(KEY_D):
		velocity.x += 1
	if Input.is_key_pressed(KEY_A):
		velocity.x -= 1
	velocity *= speed
	velocity = move_and_slide(velocity)