main.tscn 6.8 KB

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