main.tscn 6.5 KB

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