code-game-jam-drop-plafond-.../scripts/player_control.gd

15 lines
452 B
GDScript

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