Browse Source

Tell player to click

Help disappear at first click.
DricomDragon 3 years ago
parent
commit
25f6938e1e
2 changed files with 31 additions and 0 deletions
  1. 19 0
      godot/scenes/main.tscn
  2. 12 0
      godot/scripts/UI.gd

+ 19 - 0
godot/scenes/main.tscn

@@ -154,6 +154,24 @@ text = "Game Over"
 align = 1
 valign = 1
 
+[node name="TutorialPanel" type="Panel" parent="UI"]
+margin_left = 100.0
+margin_top = 175.0
+margin_right = 300.0
+margin_bottom = 225.0
+__meta__ = {
+"_edit_use_anchors_": false
+}
+
+[node name="TutorialLabel" type="Label" parent="UI/TutorialPanel"]
+margin_left = -100.0
+margin_top = -175.0
+margin_right = 300.0
+margin_bottom = 225.0
+text = "Click to shoot a ball !"
+align = 1
+valign = 1
+
 [node name="BallCounterPanel" type="Panel" parent="UI"]
 margin_left = 10.0
 margin_top = 360.0
@@ -219,6 +237,7 @@ __meta__ = {
 [connection signal="game_over" from="Catcher" to="UI" method="_on_Catcher_game_over"]
 [connection signal="gain_new_bullet" from="Launcher" to="UI/BallCounterPanel/BallCounterLabel" method="_on_Launcher_gain_new_bullet"]
 [connection signal="get_firing" from="Launcher" to="Launcher" method="_on_Launcher_get_firing"]
+[connection signal="get_firing" from="Launcher" to="UI" method="_on_Launcher_get_firing"]
 [connection signal="is_full" from="Launcher" to="Launcher/Grid" method="_on_Launcher_is_full"]
 [connection signal="move_visor" from="Launcher" to="Launcher/TargetLine" method="_on_Launcher_move_visor"]
 [connection signal="has_moved" from="Launcher/Grid" to="Launcher" method="_on_Grid_has_moved"]

+ 12 - 0
godot/scripts/UI.gd

@@ -1,6 +1,14 @@
 extends Control
 
+
 onready var game_over_panel = $GameOverPanel
+onready var tutorial_panel = $TutorialPanel
+
+
+func hide_tutorial():
+	if tutorial_panel:
+		tutorial_panel.queue_free()
+		tutorial_panel = null
 
 
 func show_end_of_game():
@@ -13,3 +21,7 @@ func _on_Catcher_game_over():
 
 func _on_DeadLine_game_lost():
 	show_end_of_game()
+
+
+func _on_Launcher_get_firing():
+	hide_tutorial()