aboutsummaryrefslogtreecommitdiff
path: root/client/map/items/item.gd
diff options
context:
space:
mode:
authortpart <tpart120@proton.me>2025-06-06 18:04:05 +0200
committertpart <tpart120@proton.me>2025-06-06 18:04:11 +0200
commit22d5a487627bccd9f8f99895f04d9107107b7a6b (patch)
treed977dc64203a253f2c64541fde414c0c73ca73ea /client/map/items/item.gd
parentfe11bc036ad342e178ba29e66e014baa1e60d380 (diff)
downloadhurrycurry-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.gd15
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):