1
Fork 0
mirror of https://github.com/Cookie-CHR/OfficeMadness-LD51.git synced 2024-11-23 15:14:18 +00:00
office-madness/Scripts/ProgressBar.gd

22 lines
445 B
GDScript3
Raw Permalink Normal View History

2022-10-02 22:44:58 +00:00
extends TextureProgress
var finished = false
# Called when the node enters the scene tree for the first time.
func _ready():
value = 0
2022-10-02 23:26:06 +00:00
max_value = 200 + 0.2*GlobalTimer.seconds_passed
2022-10-02 22:44:58 +00:00
func _process(delta):
if not finished:
if value >= max_value:
finished = true
MManager.on_finished()
else:
2022-10-02 23:26:06 +00:00
self.value -= (delta+0.0001*GlobalTimer.seconds_passed)*20
2022-10-02 22:44:58 +00:00
func boost():
value +=10
if value >= max_value:
MManager.on_finished()