aboutsummaryrefslogtreecommitdiff
path: root/client/player
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-09-19 20:23:54 +0200
committermetamuffin <metamuffin@disroot.org>2024-09-19 20:23:54 +0200
commit153e778d7d7085d699cf98da38a1196e5e81331a (patch)
treeb35723bc87980c07d046f042c0170aba735c853f /client/player
parent65f7af7182e725ba0d457e1df75794f0e8ed2654 (diff)
downloadhurrycurry-153e778d7d7085d699cf98da38a1196e5e81331a.tar
hurrycurry-153e778d7d7085d699cf98da38a1196e5e81331a.tar.bz2
hurrycurry-153e778d7d7085d699cf98da38a1196e5e81331a.tar.zst
Revert "draft for accessible movement"
This reverts commit abcaa25c5b3de7da498494f36efebbafa34130a3.
Diffstat (limited to 'client/player')
-rw-r--r--client/player/controllable_player.gd22
1 files changed, 6 insertions, 16 deletions
diff --git a/client/player/controllable_player.gd b/client/player/controllable_player.gd
index 9e7ce2b2..142d5f47 100644
--- a/client/player/controllable_player.gd
+++ b/client/player/controllable_player.gd
@@ -58,11 +58,10 @@ func _process(delta):
super(delta)
update_touch_scrolls()
-var moving_duration = 0
func _process_movement(delta):
var input = Input.get_vector("left", "right", "forwards", "backwards") if is_input_enabled() else Vector2.ZERO
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( - game.camera.angle_target)
if Input.is_action_pressed("interact") or Input.is_action_just_released("interact"):
input *= 0
else:
@@ -70,13 +69,6 @@ func _process_movement(delta):
int(floor(movement_base.position.x + sin(movement_base.rotation.y))),
int(floor(movement_base.position.z + cos(movement_base.rotation.y)))
)
-
- if Global.get_setting("gameplay.accessible_movement"):
- if input.length() < 0.5: moving_duration -= delta * 2
- else: moving_duration += delta
- moving_duration = clamp(moving_duration, 0, 1)
- input *= min(1, moving_duration)
-
interact()
var was_boosting = boosting
direction = input
@@ -89,10 +81,8 @@ func _process_movement(delta):
func update(dt: float, boost: bool):
direction = direction.limit_length(1.);
- if direction.length() > 0.05:
- self.facing = direction + (self.facing - direction) * exp(-dt * 10.)
- if direction.length() < 0.5:
- direction *= 0
+ if direction.length() > 0.1:
+ self.facing = direction + (self.facing - direction) * exp( - dt * 10.)
rotation_ = atan2(self.facing.x, self.facing.y);
boost = boost and direction.length() > 0.1
boosting = boost and (boosting or stamina >= 1.0) and stamina > 0
@@ -102,12 +92,12 @@ func update(dt: float, boost: bool):
var speed = PLAYER_SPEED * (BOOST_FACTOR if boosting else 1.)
self.velocity_ += direction * dt * speed
self.position_ += self.velocity_ * dt
- self.velocity_ = self.velocity_ * exp(-dt * PLAYER_FRICTION)
+ self.velocity_ = self.velocity_ * exp( - dt * PLAYER_FRICTION)
collide(dt)
func collide(dt: float):
- for xo in range(-1, 2):
- for yo in range(-1, 2):
+ for xo in range( - 1, 2):
+ for yo in range( - 1, 2):
var tile = Vector2i(xo, yo) + Vector2i(self.position_)
if !game.get_tile_collision(tile): continue
tile = Vector2(tile)