diff options
author | nokoe <nokoe@mailbox.org> | 2024-06-27 00:03:49 +0200 |
---|---|---|
committer | nokoe <nokoe@mailbox.org> | 2024-06-27 00:03:49 +0200 |
commit | 336f7f159be619fef0ec7665fccfd6204879d879 (patch) | |
tree | 396c2af22f835cd0b6fd1b901ca2d953de53aa8e /client/player/controllable_player.gd | |
parent | ec4e2769ee7148cbc0afa329f5fe5922051abba8 (diff) | |
download | hurrycurry-336f7f159be619fef0ec7665fccfd6204879d879.tar hurrycurry-336f7f159be619fef0ec7665fccfd6204879d879.tar.bz2 hurrycurry-336f7f159be619fef0ec7665fccfd6204879d879.tar.zst |
add walking particles
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.); |