main.tscn 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  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.5, 10.5 )
  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. visor_ratio = 1.6
  70. [node name="Grid" type="TileMap" parent="Launcher" groups=[
  71. "grid",
  72. ]]
  73. mode = 2
  74. tile_set = SubResource( 6 )
  75. cell_size = Vector2( 40, 20 )
  76. cell_custom_transform = Transform2D( 40, 0, 0, 20, 0, 0 )
  77. collision_layer = 4
  78. collision_mask = 8
  79. format = 1
  80. script = ExtResource( 6 )
  81. [node name="LifeContainer" type="Node2D" parent="Launcher/Grid"]
  82. script = ExtResource( 10 )
  83. [node name="Target" type="Sprite" parent="Launcher"]
  84. position = Vector2( 200, 400 )
  85. texture = ExtResource( 5 )
  86. [node name="Source" type="Sprite" parent="Launcher"]
  87. position = Vector2( 200, 400 )
  88. texture = ExtResource( 1 )
  89. [node name="ShootDelay" type="Timer" parent="Launcher"]
  90. wait_time = 0.1
  91. one_shot = true
  92. [node name="DeadLine" type="RayCast2D" parent="Launcher"]
  93. position = Vector2( 380, 390 )
  94. cast_to = Vector2( -360, 0 )
  95. collision_mask = 4
  96. script = ExtResource( 11 )
  97. [node name="UI" type="Control" parent="."]
  98. margin_right = 40.0
  99. margin_bottom = 40.0
  100. script = ExtResource( 7 )
  101. __meta__ = {
  102. "_edit_use_anchors_": false
  103. }
  104. [node name="GameOverPanel" type="Panel" parent="UI"]
  105. visible = false
  106. margin_left = 100.0
  107. margin_top = 175.0
  108. margin_right = 300.0
  109. margin_bottom = 225.0
  110. __meta__ = {
  111. "_edit_use_anchors_": false
  112. }
  113. [node name="GameOver" type="Label" parent="UI/GameOverPanel"]
  114. margin_left = -100.0
  115. margin_top = -175.0
  116. margin_right = 300.0
  117. margin_bottom = 225.0
  118. text = "Game Over"
  119. align = 1
  120. valign = 1
  121. [node name="BallCounterPanel" type="Panel" parent="UI"]
  122. margin_left = 10.0
  123. margin_top = 360.0
  124. margin_right = 50.0
  125. margin_bottom = 390.0
  126. __meta__ = {
  127. "_edit_use_anchors_": false
  128. }
  129. [node name="BallLabel" type="Label" parent="UI/BallCounterPanel"]
  130. margin_right = 40.0
  131. margin_bottom = 14.0
  132. text = "Balls"
  133. align = 1
  134. valign = 1
  135. __meta__ = {
  136. "_edit_use_anchors_": false
  137. }
  138. [node name="BallCounterLabel" type="Label" parent="UI/BallCounterPanel"]
  139. margin_top = 15.0
  140. margin_right = 40.0
  141. margin_bottom = 30.0
  142. text = "0"
  143. align = 1
  144. valign = 1
  145. script = ExtResource( 8 )
  146. __meta__ = {
  147. "_edit_use_anchors_": false
  148. }
  149. [node name="ScorePanel" type="Panel" parent="UI"]
  150. margin_left = 350.0
  151. margin_top = 360.0
  152. margin_right = 390.0
  153. margin_bottom = 390.0
  154. __meta__ = {
  155. "_edit_use_anchors_": false
  156. }
  157. [node name="ScoreLabel" type="Label" parent="UI/ScorePanel"]
  158. margin_right = 40.0
  159. margin_bottom = 14.0
  160. text = "Score"
  161. align = 1
  162. valign = 1
  163. __meta__ = {
  164. "_edit_use_anchors_": false
  165. }
  166. [node name="ScoreCounterLabel" type="Label" parent="UI/ScorePanel"]
  167. margin_top = 15.0
  168. margin_right = 40.0
  169. margin_bottom = 30.0
  170. text = "0"
  171. align = 1
  172. valign = 1
  173. script = ExtResource( 9 )
  174. __meta__ = {
  175. "_edit_use_anchors_": false
  176. }
  177. [connection signal="body_entered" from="Catcher" to="Catcher" method="_on_Catcher_body_entered"]
  178. [connection signal="game_over" from="Catcher" to="UI" method="_on_Catcher_game_over"]
  179. [connection signal="gain_new_bullet" from="Launcher" to="UI/BallCounterPanel/BallCounterLabel" method="_on_Launcher_gain_new_bullet"]
  180. [connection signal="get_firing" from="Launcher" to="Launcher" method="_on_Launcher_get_firing"]
  181. [connection signal="is_full" from="Launcher" to="Launcher/Grid" method="_on_Launcher_is_full"]
  182. [connection signal="has_moved" from="Launcher/Grid" to="Launcher" method="_on_Grid_has_moved"]
  183. [connection signal="has_moved" from="Launcher/Grid" to="Launcher/DeadLine" method="_on_Grid_has_moved"]
  184. [connection signal="kace_broken" from="Launcher/Grid" to="Launcher" method="_on_Grid_kace_broken"]
  185. [connection signal="kace_damaged" from="Launcher/Grid" to="UI/ScorePanel/ScoreCounterLabel" method="_on_Grid_kace_damaged"]
  186. [connection signal="timeout" from="Launcher/ShootDelay" to="Launcher" method="_on_ShootDelay_timeout"]
  187. [connection signal="game_lost" from="Launcher/DeadLine" to="Launcher" method="_on_DeadLine_game_lost"]
  188. [connection signal="game_lost" from="Launcher/DeadLine" to="UI" method="_on_DeadLine_game_lost"]