diff options
author | tpart <tpart120@proton.me> | 2025-06-06 18:04:05 +0200 |
---|---|---|
committer | tpart <tpart120@proton.me> | 2025-06-06 18:04:11 +0200 |
commit | 22d5a487627bccd9f8f99895f04d9107107b7a6b (patch) | |
tree | d977dc64203a253f2c64541fde414c0c73ca73ea /client/map/items/item.gd | |
parent | fe11bc036ad342e178ba29e66e014baa1e60d380 (diff) | |
download | hurrycurry-22d5a487627bccd9f8f99895f04d9107107b7a6b.tar hurrycurry-22d5a487627bccd9f8f99895f04d9107107b7a6b.tar.bz2 hurrycurry-22d5a487627bccd9f8f99895f04d9107107b7a6b.tar.zst |
Correctly implement pausing (Fix #284)
Diffstat (limited to 'client/map/items/item.gd')
-rw-r--r-- | client/map/items/item.gd | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/client/map/items/item.gd b/client/map/items/item.gd index f7592d87..eed38596 100644 --- a/client/map/items/item.gd +++ b/client/map/items/item.gd @@ -79,14 +79,15 @@ func _process(delta): if destroy_timeout <= 0: queue_free() else: scale = Vector3.ONE * destroy_timeout + if !Global.game_paused: + progress_position += delta * progress_speed + progress_instance.update(progress_position, progress_warn) + var time_remaining = (1 - progress_position) / progress_speed - progress_position += delta * progress_speed - progress_instance.update(progress_position, progress_warn) - var time_remaining = (1 - progress_position) / progress_speed - - if progress_warn and progress_speed > 0 and time_remaining < 5.: - if not beep_sound.playing: - beep_sound.play() + if progress_warn and progress_speed > 0 and time_remaining < 5.: + if not beep_sound.playing: + beep_sound.play() + else: beep_sound.stop() else: beep_sound.stop() func progress(position_: float, speed: float, warn: bool): |