Add moving player and borders
This commit is contained in:
parent
ddbd53292c
commit
ffcaeccc2f
7 changed files with 61 additions and 63 deletions
15
scripts/player_control.gd
Normal file
15
scripts/player_control.gd
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue