diff options
Diffstat (limited to 'client/player/controllable_player.gd')
-rw-r--r-- | client/player/controllable_player.gd | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/client/player/controllable_player.gd b/client/player/controllable_player.gd index 67c6db63..82365b83 100644 --- a/client/player/controllable_player.gd +++ b/client/player/controllable_player.gd @@ -29,6 +29,7 @@ var facing = Vector2(1, 0) var velocity_ = Vector2(0, 0) var stamina = 0 var boosting := false +var was_boosting := false var chat_open := false var target: Vector2i = Vector2i(0, 0) @@ -87,8 +88,14 @@ func update(dt: float, input: Vector2, boost: bool): rotation_ = atan2(self.facing.x, self.facing.y); boost = boost and input.length() > 0.1 boosting = boost and (boosting or stamina >= 1.0) and stamina > 0 - if boosting: stamina -= dt / BOOST_DURATION - else: stamina += dt / BOOST_RESTORE + if boosting: + stamina -= dt / BOOST_DURATION + if not was_boosting: + Input.start_joy_vibration(0, 0, 1, 0.15) + was_boosting = true + else: + stamina += dt / BOOST_RESTORE + was_boosting = false stamina = max(min(stamina, 1.0), 0.0) var speed = PLAYER_SPEED * (BOOST_FACTOR if boosting else 1.) self.velocity_ += input * dt * speed; |