main.tscn 6.1 KB

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