Add moving player and borders

This commit is contained in:
Renarde-dev 2025-01-24 11:38:05 +01:00
parent ddbd53292c
commit ffcaeccc2f
No known key found for this signature in database
GPG key ID: 5B8FE0B3816369DE
7 changed files with 61 additions and 63 deletions

15
scripts/player_control.gd Normal file
View file

@ -0,0 +1,15 @@
extends CharacterBody2D
const move_speed = 400
func _physics_process(delta: float) -> void:
move_and_slide()
func _process(delta: float) -> void:
var direction : Vector2 = Vector2.ZERO
direction.x = Input.get_action_raw_strength("BOUGER_DROITE") - Input.get_action_raw_strength("BOUGER_GAUCHE")
direction.y = Input.get_action_raw_strength("BOUGER_BAS") - Input.get_action_raw_strength("BOUGER_HAUT")
velocity = direction * move_speed
pass