Switch to 2 spaces
This commit is contained in:
parent
3d047f3a8b
commit
9cd7629023
2 changed files with 19 additions and 19 deletions
16
Paddle.gd
16
Paddle.gd
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue