Switch to 2 spaces

This commit is contained in:
Jennie Robinson Faber 2025-08-24 15:47:12 +01:00
parent 3d047f3a8b
commit 9cd7629023
2 changed files with 19 additions and 19 deletions

View file

@ -5,13 +5,13 @@ const SPEED: float = 350.0
@export var player_id: int
func _input(event: InputEvent) -> void:
if event.is_action_pressed('up-%d' % player_id):
velocity = Vector2(0, -SPEED)
if event.is_action_pressed( 'down-%d' % player_id):
velocity = Vector2(0, SPEED)
if event.is_action_released('up-%d' % player_id) or \
event.is_action_released('down-%d' % player_id):
velocity = Vector2.ZERO
if event.is_action_pressed('up-%d' % player_id):
velocity = Vector2(0, -SPEED)
if event.is_action_pressed( 'down-%d' % player_id):
velocity = Vector2(0, SPEED)
if event.is_action_released('up-%d' % player_id) or \
event.is_action_released('down-%d' % player_id):
velocity = Vector2.ZERO
func _physics_process(_delta: float) -> void:
move_and_slide()
move_and_slide()