freettrpg/scripts/player.gd

12 lines
237 B
GDScript3
Raw Normal View History

2024-06-13 13:29:05 +02:00
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()