freettrpg/scripts/player.gd
2024-06-13 13:29:05 +02:00

11 lines
237 B
GDScript

extends CharacterBody2D
@export var speed = 200
func get_input():
var input_direction = Input.get_vector("left", "right", "up", "down")
velocity = input_direction * speed
func _physics_process(delta):
get_input()
move_and_slide()