basic player movement

This commit is contained in:
Booklordofthedings 2024-08-16 21:03:06 +02:00
parent f1eaee23c3
commit 5510d89edc
3 changed files with 43 additions and 1 deletions

View file

@ -0,0 +1,11 @@
extends CharacterBody2D
@export var speed = 50
func get_input():
var input_direction = Input.get_axis("player_left", "player_right")
velocity.x = input_direction * speed
func _physics_process(delta):
get_input()
move_and_slide()