diff options
author | metamuffin <metamuffin@disroot.org> | 2024-09-21 19:51:44 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-09-21 19:51:44 +0200 |
commit | 9aae9ed16b3072ce46e7448c0dd5482c95a38faf (patch) | |
tree | 90890ad911ecd8805ca155fcbd74c1e258b3e8a8 /client/player/controllable_player.gd | |
parent | f2a61d6d60ba1d628ccc7ee3b591e5fdb601e59f (diff) | |
download | hurrycurry-9aae9ed16b3072ce46e7448c0dd5482c95a38faf.tar hurrycurry-9aae9ed16b3072ce46e7448c0dd5482c95a38faf.tar.bz2 hurrycurry-9aae9ed16b3072ce46e7448c0dd5482c95a38faf.tar.zst |
first person mode
Diffstat (limited to 'client/player/controllable_player.gd')
-rw-r--r-- | client/player/controllable_player.gd | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/client/player/controllable_player.gd b/client/player/controllable_player.gd index 5dda6a69..8dcdc6f0 100644 --- a/client/player/controllable_player.gd +++ b/client/player/controllable_player.gd @@ -32,6 +32,7 @@ var direction := Vector2(0, 0) var stamina := 0. var chat_open := false var enable_input := true +var input_rotation = 0 var target: Vector2i = Vector2i(0, 0) @@ -61,8 +62,11 @@ func _process(delta): var moving_duration = 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 + input.y = min(input.y, 0) var boost = Input.is_action_pressed("boost") or (Global.get_setting("gameplay.latch_boost") and boosting) - input = input.rotated(-game.camera.angle_target) + input = input.rotated(input_rotation) if Input.is_action_pressed("interact") or Input.is_action_just_released("interact"): input *= 0 else: |