main.tscn 5.5 KB

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