main.tscn 5.7 KB

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