diff options
| author | metamuffin <metamuffin@disroot.org> | 2024-06-27 00:38:13 +0200 |
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2024-06-27 00:38:13 +0200 |
| commit | 0cdc668ff70f3eed492dcb5d9e68ba3d2d9fa541 (patch) | |
| tree | ebf64c37476279bb2ab007a0a72b1bc0ce865501 /client/player/controllable_player.gd | |
| parent | 3f7625c02320c1e58da0f579750c76dc47603085 (diff) | |
| parent | fd629cefc69189751f003dc3add47666f2742ae3 (diff) | |
| download | hurrycurry-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.gd | 3 |
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.); |