main.tscn 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. [gd_scene load_steps=17 format=2]
  2. [ext_resource path="res://component/ui/BallCounterLabel.gd" type="Script" id=1]
  3. [ext_resource path="res://component/entity/launcher/TargetLine.gd" type="Script" id=2]
  4. [ext_resource path="res://component/entity/catcher/Catcher.gd" type="Script" id=3]
  5. [ext_resource path="res://component/ui/LifeContainer.gd" type="Script" id=4]
  6. [ext_resource path="res://component/ui/UI.gd" type="Script" id=5]
  7. [ext_resource path="res://component/ui/ScoreCounterLabel.gd" type="Script" id=6]
  8. [ext_resource path="res://component/entity/death/DeadLine.gd" type="Script" id=7]
  9. [ext_resource path="res://component/entity/launcher/Launcher.gd" type="Script" id=8]
  10. [ext_resource path="res://component/entity/brick/brick_tileset.tres" type="TileSet" id=9]
  11. [ext_resource path="res://component/entity/launcher/visor.png" type="Texture" id=10]
  12. [ext_resource path="res://component/entity/launcher/launcher.png" type="Texture" id=11]
  13. [ext_resource path="res://component/entity/brick/Grid.gd" type="Script" id=12]
  14. [sub_resource type="PhysicsMaterial" id=1]
  15. friction = 0.0
  16. bounce = 1.0
  17. [sub_resource type="RectangleShape2D" id=2]
  18. extents = Vector2( 50, 300 )
  19. [sub_resource type="RectangleShape2D" id=3]
  20. extents = Vector2( 300, 50 )
  21. [sub_resource type="RectangleShape2D" id=4]
  22. extents = Vector2( 200, 50 )
  23. [node name="Root" type="Node"]
  24. [node name="Background" type="Panel" parent="."]
  25. margin_right = 400.0
  26. margin_bottom = 400.0
  27. __meta__ = {
  28. "_edit_use_anchors_": false
  29. }
  30. [node name="Walls" type="StaticBody2D" parent="."]
  31. collision_layer = 2
  32. physics_material_override = SubResource( 1 )
  33. [node name="Left" type="CollisionShape2D" parent="Walls"]
  34. position = Vector2( -50, 200 )
  35. shape = SubResource( 2 )
  36. [node name="Right" type="CollisionShape2D" parent="Walls"]
  37. position = Vector2( 450, 200 )
  38. shape = SubResource( 2 )
  39. [node name="Top" type="CollisionShape2D" parent="Walls"]
  40. position = Vector2( 200, -50 )
  41. shape = SubResource( 3 )
  42. [node name="Catcher" type="Area2D" parent="."]
  43. position = Vector2( 200, 460 )
  44. collision_layer = 8
  45. collision_mask = 5
  46. script = ExtResource( 3 )
  47. [node name="Area" type="CollisionShape2D" parent="Catcher"]
  48. shape = SubResource( 4 )
  49. [node name="Launcher" type="Node2D" parent="."]
  50. script = ExtResource( 8 )
  51. visor_ratio = 1.6
  52. [node name="Grid" type="TileMap" parent="Launcher" groups=[
  53. "grid",
  54. ]]
  55. mode = 2
  56. tile_set = ExtResource( 9 )
  57. cell_size = Vector2( 40, 20 )
  58. cell_custom_transform = Transform2D( 40, 0, 0, 20, 0, 0 )
  59. collision_layer = 4
  60. collision_mask = 8
  61. format = 1
  62. script = ExtResource( 12 )
  63. [node name="LifeContainer" type="Node2D" parent="Launcher/Grid"]
  64. script = ExtResource( 4 )
  65. [node name="MoveDown" type="Tween" parent="Launcher/Grid"]
  66. __meta__ = {
  67. "_editor_description_": "Move grid to show the new row"
  68. }
  69. [node name="TargetLine" type="RayCast2D" parent="Launcher"]
  70. position = Vector2( 200, 400 )
  71. collision_mask = 6
  72. script = ExtResource( 2 )
  73. [node name="TargetVisor" type="Sprite" parent="Launcher/TargetLine"]
  74. texture = ExtResource( 10 )
  75. [node name="Source" type="Sprite" parent="Launcher"]
  76. position = Vector2( 200, 400 )
  77. texture = ExtResource( 11 )
  78. [node name="ShootDelay" type="Timer" parent="Launcher"]
  79. wait_time = 0.1
  80. one_shot = true
  81. [node name="DeadLine" type="RayCast2D" parent="Launcher"]
  82. position = Vector2( 380, 390 )
  83. cast_to = Vector2( -360, 0 )
  84. collision_mask = 4
  85. script = ExtResource( 7 )
  86. [node name="UI" type="Control" parent="."]
  87. margin_right = 40.0
  88. margin_bottom = 40.0
  89. script = ExtResource( 5 )
  90. __meta__ = {
  91. "_edit_use_anchors_": false
  92. }
  93. [node name="GameOverPanel" type="Panel" parent="UI"]
  94. visible = false
  95. margin_left = 100.0
  96. margin_top = 175.0
  97. margin_right = 300.0
  98. margin_bottom = 225.0
  99. __meta__ = {
  100. "_edit_use_anchors_": false
  101. }
  102. [node name="GameOver" type="Label" parent="UI/GameOverPanel"]
  103. margin_left = -100.0
  104. margin_top = -175.0
  105. margin_right = 300.0
  106. margin_bottom = 225.0
  107. text = "Game Over"
  108. align = 1
  109. valign = 1
  110. [node name="TutorialPanel" type="Panel" parent="UI"]
  111. margin_left = 100.0
  112. margin_top = 175.0
  113. margin_right = 300.0
  114. margin_bottom = 225.0
  115. __meta__ = {
  116. "_edit_use_anchors_": false
  117. }
  118. [node name="TutorialLabel" type="Label" parent="UI/TutorialPanel"]
  119. margin_left = -100.0
  120. margin_top = -175.0
  121. margin_right = 300.0
  122. margin_bottom = 225.0
  123. text = "Click to shoot a ball !"
  124. align = 1
  125. valign = 1
  126. [node name="BallCounterPanel" type="Panel" parent="UI"]
  127. margin_left = 10.0
  128. margin_top = 360.0
  129. margin_right = 50.0
  130. margin_bottom = 390.0
  131. __meta__ = {
  132. "_edit_use_anchors_": false
  133. }
  134. [node name="BallLabel" type="Label" parent="UI/BallCounterPanel"]
  135. margin_right = 40.0
  136. margin_bottom = 14.0
  137. text = "Balls"
  138. align = 1
  139. valign = 1
  140. __meta__ = {
  141. "_edit_use_anchors_": false
  142. }
  143. [node name="BallCounterLabel" type="Label" parent="UI/BallCounterPanel"]
  144. margin_top = 15.0
  145. margin_right = 40.0
  146. margin_bottom = 30.0
  147. text = "0"
  148. align = 1
  149. valign = 1
  150. script = ExtResource( 1 )
  151. __meta__ = {
  152. "_edit_use_anchors_": false
  153. }
  154. [node name="ScorePanel" type="Panel" parent="UI"]
  155. margin_left = 350.0
  156. margin_top = 360.0
  157. margin_right = 390.0
  158. margin_bottom = 390.0
  159. __meta__ = {
  160. "_edit_use_anchors_": false
  161. }
  162. [node name="ScoreLabel" type="Label" parent="UI/ScorePanel"]
  163. margin_right = 40.0
  164. margin_bottom = 14.0
  165. text = "Score"
  166. align = 1
  167. valign = 1
  168. __meta__ = {
  169. "_edit_use_anchors_": false
  170. }
  171. [node name="ScoreCounterLabel" type="Label" parent="UI/ScorePanel"]
  172. margin_top = 15.0
  173. margin_right = 40.0
  174. margin_bottom = 30.0
  175. text = "0"
  176. align = 1
  177. valign = 1
  178. script = ExtResource( 6 )
  179. __meta__ = {
  180. "_edit_use_anchors_": false
  181. }
  182. [connection signal="body_entered" from="Catcher" to="Catcher" method="_on_Catcher_body_entered"]
  183. [connection signal="game_over" from="Catcher" to="UI" method="_on_Catcher_game_over"]
  184. [connection signal="gain_new_bullet" from="Launcher" to="UI/BallCounterPanel/BallCounterLabel" method="_on_Launcher_gain_new_bullet"]
  185. [connection signal="get_firing" from="Launcher" to="Launcher" method="_on_Launcher_get_firing"]
  186. [connection signal="get_firing" from="Launcher" to="UI" method="_on_Launcher_get_firing"]
  187. [connection signal="is_full" from="Launcher" to="Launcher/Grid" method="_on_Launcher_is_full"]
  188. [connection signal="move_visor" from="Launcher" to="Launcher/TargetLine" method="_on_Launcher_move_visor"]
  189. [connection signal="has_moved" from="Launcher/Grid" to="Launcher/DeadLine" method="_on_Grid_has_moved"]
  190. [connection signal="has_moved" from="Launcher/Grid" to="Launcher" method="_on_Grid_has_moved"]
  191. [connection signal="kace_broken" from="Launcher/Grid" to="Launcher" method="_on_Grid_kace_broken"]
  192. [connection signal="kace_damaged" from="Launcher/Grid" to="UI/ScorePanel/ScoreCounterLabel" method="_on_Grid_kace_damaged"]
  193. [connection signal="tween_all_completed" from="Launcher/Grid/MoveDown" to="Launcher/Grid" method="_on_MoveDown_tween_all_completed"]
  194. [connection signal="timeout" from="Launcher/ShootDelay" to="Launcher" method="_on_ShootDelay_timeout"]
  195. [connection signal="game_lost" from="Launcher/DeadLine" to="Launcher" method="_on_DeadLine_game_lost"]
  196. [connection signal="game_lost" from="Launcher/DeadLine" to="UI" method="_on_DeadLine_game_lost"]