diff options
Diffstat (limited to 'client/player/controllable_player.gd')
-rw-r--r-- | client/player/controllable_player.gd | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/client/player/controllable_player.gd b/client/player/controllable_player.gd index 0cabcb64..131bc55d 100644 --- a/client/player/controllable_player.gd +++ b/client/player/controllable_player.gd @@ -43,7 +43,7 @@ func _ready(): add_child(timer) timer.start() timer.connect("timeout", func(): - if game.mp != null and game.join_sent: + if game.mp != null and game.join_state == Game.JoinState.JOINED: game.mp.send_movement(game.player_id, position_, direction, boosting) ) add_child(onscreen_controls) @@ -60,13 +60,20 @@ func _process(delta): update_touch_scrolls() var moving_duration = 0 +var fps_rotation_target = 0 func _process_movement(delta): var input = Input.get_vector("left", "right", "forwards", "backwards") if is_input_enabled() else Vector2.ZERO if Global.get_setting("gameplay.first_person"): - input.x *= 0.1 + fps_rotation_target += input.x * delta * 3. + if abs(input.x) > 0.1: input.y -= 0.5 + input.x = 0. input.y = min(input.y, 0) + input = input.rotated(fps_rotation_target) + else: + input = input.rotated(input_rotation) + var boost = Input.is_action_pressed("boost") or (Global.get_setting("gameplay.latch_boost") and boosting) - input = input.rotated(input_rotation) + # if Input.is_action_pressed("interact") or Input.is_action_just_released("interact"): input *= 0 else: |