diff options
author | metamuffin <metamuffin@disroot.org> | 2024-09-28 19:09:35 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-09-28 19:09:35 +0200 |
commit | d644c5fd05b082b5a56d233e670689553242fa2c (patch) | |
tree | 007ae28fe98c46472ddcb48d5d2ed4dd825e5e87 | |
parent | 8150a7002ef731780789a626b12e8d5319da9033 (diff) | |
download | hurrycurry-d644c5fd05b082b5a56d233e670689553242fa2c.tar hurrycurry-d644c5fd05b082b5a56d233e670689553242fa2c.tar.bz2 hurrycurry-d644c5fd05b082b5a56d233e670689553242fa2c.tar.zst |
reliable fps movement
-rw-r--r-- | client/player/controllable_player.gd | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/client/player/controllable_player.gd b/client/player/controllable_player.gd index c88941d7..131bc55d 100644 --- a/client/player/controllable_player.gd +++ b/client/player/controllable_player.gd @@ -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: |