Browse Source

improve minigame timings

Arnaud Vergnet 6 months ago
parent
commit
91500ed2e8

+ 9
- 8
mini-game/MiniGame.gd View File

@@ -42,22 +42,23 @@ func set_mode(mode: String):
42 42
 func start():
43 43
 	print("starting minigame")
44 44
 	start_timer_UI.init()
45
-	var t = Timer.new() 	
46
-	t.set_wait_time(1) 		
47
-	add_child(t)			
48
-	t.start()			
45
+	var t = Timer.new()
46
+	t.set_wait_time(0.5)
47
+	add_child(t)
48
+	t.start()
49 49
 	for n in range(3,0,-1):
50 50
 		start_timer_UI.update_timer(String(n))
51 51
 		yield(t, "timeout")
52 52
 	start_timer_UI.update_timer("GO !")
53
-	yield(t, "timeout")
54
-	t.queue_free()
53
+	instructionsUI._init()
55 54
 	foreground.start()
56 55
 	player.start(game_mode)
56
+	yield(t, "timeout")
57
+	yield(t, "timeout")
58
+	start_timer_UI.hide()
57 59
 	spawner.start()
58
-	instructionsUI._init()
59 60
 	scoreUI.start(game_mode)
60
-	start_timer_UI.hide()
61
+	t.queue_free()
61 62
 
62 63
 
63 64
 func stop():

+ 1
- 0
mini-game/scenes/decor/instructionsUI.gd View File

@@ -18,6 +18,7 @@ func _wait_for_jump():
18 18
 			hide()
19 19
 		else:
20 20
 			show()
21
+			yield(t, "timeout")
21 22
 	hide()
22 23
 
23 24
 func _input(event):

+ 1
- 1
mini-game/scenes/decor/instructionsUI.tscn View File

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

Loading…
Cancel
Save