diff options
Diffstat (limited to 'game/main.gd')
-rw-r--r-- | game/main.gd | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/game/main.gd b/game/main.gd index 6dc8532..03531c7 100644 --- a/game/main.gd +++ b/game/main.gd @@ -5,8 +5,12 @@ const MICROGAMES = [preload("res://game/microgames/flowers_delivery/flowers_deli @onready var transition: Transition = %Transition @onready var microgame_viewport = %MicrogameViewport @onready var microgame_subviewport = %MicrogameSubViewport +@onready var microgame_timer: Timer = %MicrogameTimer var _current_microgame: Microgame +var _starting = true +var _won_last_microgame = false +var _microgame_count = 1 func _ready() -> void: @@ -20,19 +24,23 @@ func _ready() -> void: while true: if _current_microgame != null: _current_microgame.process_mode = Node.PROCESS_MODE_DISABLED - - transition.show_win_animation() - - await transition.microgame_viewport_hidden - - if _current_microgame != null: + + await transition.microgame_fade_out() _current_microgame.queue_free() + + await transition.play_result_animation(_won_last_microgame) _current_microgame = MICROGAMES[0].instantiate() microgame_subviewport.add_child(_current_microgame) _current_microgame.process_mode = Node.PROCESS_MODE_DISABLED - await transition.finished + await transition.play_microgame_count(_microgame_count) + + await transition.microgame_fade_in() + _current_microgame.process_mode = Node.PROCESS_MODE_INHERIT - await _current_microgame.finished + _won_last_microgame = await _current_microgame.finished + + _starting = false + _microgame_count += 1 |