improve minigame timings

This commit is contained in:
Arnaud Vergnet 2021-04-12 10:48:46 +02:00
parent e894808313
commit 91500ed2e8
3 changed files with 12 additions and 10 deletions

View file

@ -42,22 +42,23 @@ func set_mode(mode: String):
func start(): func start():
print("starting minigame") print("starting minigame")
start_timer_UI.init() start_timer_UI.init()
var t = Timer.new() var t = Timer.new()
t.set_wait_time(1) t.set_wait_time(0.5)
add_child(t) add_child(t)
t.start() t.start()
for n in range(3,0,-1): for n in range(3,0,-1):
start_timer_UI.update_timer(String(n)) start_timer_UI.update_timer(String(n))
yield(t, "timeout") yield(t, "timeout")
start_timer_UI.update_timer("GO !") start_timer_UI.update_timer("GO !")
yield(t, "timeout") instructionsUI._init()
t.queue_free()
foreground.start() foreground.start()
player.start(game_mode) player.start(game_mode)
spawner.start() yield(t, "timeout")
instructionsUI._init() yield(t, "timeout")
scoreUI.start(game_mode)
start_timer_UI.hide() start_timer_UI.hide()
spawner.start()
scoreUI.start(game_mode)
t.queue_free()
func stop(): func stop():

View file

@ -18,6 +18,7 @@ func _wait_for_jump():
hide() hide()
else: else:
show() show()
yield(t, "timeout")
hide() hide()
func _input(event): func _input(event):

View file

@ -31,7 +31,7 @@ __meta__ = {
[node name="Label" type="Label" parent="MarginContainer"] [node name="Label" type="Label" parent="MarginContainer"]
margin_top = 146.0 margin_top = 146.0
margin_right = 1921.0 margin_right = 1920.0
margin_bottom = 207.0 margin_bottom = 207.0
custom_fonts/font = SubResource( 1 ) custom_fonts/font = SubResource( 1 )
text = "Appuyer sur ESPACE pour sauter" text = "Appuyer sur ESPACE pour sauter"