#5 développement du mouvement du robot et d'une caméra qui le suit

This commit is contained in:
2025-08-01 12:56:59 +02:00
parent 287a7a161f
commit b60c445592
9 changed files with 84 additions and 12 deletions

View File

@@ -0,0 +1,14 @@
extends CharacterBody2D
class_name Player
@export var speed = 400
func get_input():
var input_direction : Vector2 = Input.get_vector("move_left", "move_right", "move_up", "move_down")
velocity = input_direction * speed
if input_direction.x:
$Sprite.flip_h = (input_direction.x < 0)
func _physics_process(_delta):
get_input()
move_and_slide()

View File

@@ -0,0 +1 @@
uid://das7twcy5153p