summaryrefslogtreecommitdiff
path: root/client/player/controllable_player.gd
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-06-27 00:38:13 +0200
committermetamuffin <metamuffin@disroot.org>2024-06-27 00:38:13 +0200
commit0cdc668ff70f3eed492dcb5d9e68ba3d2d9fa541 (patch)
treeebf64c37476279bb2ab007a0a72b1bc0ce865501 /client/player/controllable_player.gd
parent3f7625c02320c1e58da0f579750c76dc47603085 (diff)
parentfd629cefc69189751f003dc3add47666f2742ae3 (diff)
downloadhurrycurry-0cdc668ff70f3eed492dcb5d9e68ba3d2d9fa541.tar
hurrycurry-0cdc668ff70f3eed492dcb5d9e68ba3d2d9fa541.tar.bz2
hurrycurry-0cdc668ff70f3eed492dcb5d9e68ba3d2d9fa541.tar.zst
Merge branch 'master' of codeberg.org:metamuffin/undercooked
Diffstat (limited to 'client/player/controllable_player.gd')
-rw-r--r--client/player/controllable_player.gd3
1 files changed, 2 insertions, 1 deletions
diff --git a/client/player/controllable_player.gd b/client/player/controllable_player.gd
index a677fdb3..32fa3135 100644
--- a/client/player/controllable_player.gd
+++ b/client/player/controllable_player.gd
@@ -58,6 +58,7 @@ func _process(delta):
update(delta, input, boost)
super(delta)
character.walking = input.length_squared() > 0.1
+ character.boosting = boosting
func update(dt: float, input: Vector2, boost: bool):
input = input.limit_length(1.);
@@ -69,7 +70,7 @@ func update(dt: float, input: Vector2, boost: bool):
if boosting: stamina -= dt / BOOST_DURATION
else: stamina += dt / BOOST_RESTORE
stamina = max(min(stamina, 1.0), 0.0)
- var speed = PLAYER_SPEED * (BOOST_FACTOR if boosting else 1)
+ var speed = PLAYER_SPEED * (BOOST_FACTOR if boosting else 1.)
self.velocity_ += input * dt * speed;
self.position_ += self.velocity_ * dt;
self.velocity_ = self.velocity_ * exp( - dt * 15.);