main.tscn 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. [gd_scene load_steps=16 format=2]
  2. [ext_resource path="res://component/entity/launcher/TargetLine.gd" type="Script" id=2]
  3. [ext_resource path="res://component/entity/catcher/Catcher.gd" type="Script" id=3]
  4. [ext_resource path="res://component/ui/LifeContainer.gd" type="Script" id=4]
  5. [ext_resource path="res://component/ui/UI.gd" type="Script" id=5]
  6. [ext_resource path="res://component/ui/number_panel/NumberPanel.tscn" type="PackedScene" id=6]
  7. [ext_resource path="res://component/entity/death/DeadLine.gd" type="Script" id=7]
  8. [ext_resource path="res://component/entity/launcher/Launcher.gd" type="Script" id=8]
  9. [ext_resource path="res://component/entity/brick/brick_tileset.tres" type="TileSet" id=9]
  10. [ext_resource path="res://component/entity/launcher/visor.png" type="Texture" id=10]
  11. [ext_resource path="res://component/entity/launcher/launcher.png" type="Texture" id=11]
  12. [ext_resource path="res://component/entity/brick/Grid.gd" type="Script" id=12]
  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. [node name="Game" type="Node"]
  23. [node name="Background" type="Panel" parent="."]
  24. margin_right = 400.0
  25. margin_bottom = 400.0
  26. __meta__ = {
  27. "_edit_use_anchors_": false
  28. }
  29. [node name="Walls" type="StaticBody2D" parent="."]
  30. collision_layer = 2
  31. physics_material_override = SubResource( 1 )
  32. [node name="Left" type="CollisionShape2D" parent="Walls"]
  33. position = Vector2( -50, 200 )
  34. shape = SubResource( 2 )
  35. [node name="Right" type="CollisionShape2D" parent="Walls"]
  36. position = Vector2( 450, 200 )
  37. shape = SubResource( 2 )
  38. [node name="Top" type="CollisionShape2D" parent="Walls"]
  39. position = Vector2( 200, -50 )
  40. shape = SubResource( 3 )
  41. [node name="Catcher" type="Area2D" parent="."]
  42. position = Vector2( 200, 460 )
  43. collision_layer = 8
  44. collision_mask = 5
  45. script = ExtResource( 3 )
  46. [node name="Area" type="CollisionShape2D" parent="Catcher"]
  47. shape = SubResource( 4 )
  48. [node name="Launcher" type="Node2D" parent="."]
  49. script = ExtResource( 8 )
  50. visor_ratio = 1.6
  51. [node name="Grid" type="TileMap" parent="Launcher" groups=[
  52. "grid",
  53. ]]
  54. mode = 2
  55. tile_set = ExtResource( 9 )
  56. cell_size = Vector2( 40, 20 )
  57. cell_custom_transform = Transform2D( 40, 0, 0, 20, 0, 0 )
  58. collision_layer = 4
  59. collision_mask = 8
  60. format = 1
  61. script = ExtResource( 12 )
  62. [node name="LifeContainer" type="Node2D" parent="Launcher/Grid"]
  63. script = ExtResource( 4 )
  64. [node name="MoveDown" type="Tween" parent="Launcher/Grid"]
  65. __meta__ = {
  66. "_editor_description_": "Move grid to show the new row"
  67. }
  68. [node name="TargetLine" type="RayCast2D" parent="Launcher"]
  69. position = Vector2( 200, 400 )
  70. collision_mask = 6
  71. script = ExtResource( 2 )
  72. [node name="TargetVisor" type="Sprite" parent="Launcher/TargetLine"]
  73. texture = ExtResource( 10 )
  74. [node name="Source" type="Sprite" parent="Launcher"]
  75. position = Vector2( 200, 400 )
  76. texture = ExtResource( 11 )
  77. [node name="ShootDelay" type="Timer" parent="Launcher"]
  78. wait_time = 0.1
  79. one_shot = true
  80. [node name="DeadLine" type="RayCast2D" parent="Launcher"]
  81. position = Vector2( 380, 390 )
  82. cast_to = Vector2( -360, 0 )
  83. collision_mask = 4
  84. script = ExtResource( 7 )
  85. [node name="UI" type="Control" parent="."]
  86. margin_right = 40.0
  87. margin_bottom = 40.0
  88. script = ExtResource( 5 )
  89. __meta__ = {
  90. "_edit_use_anchors_": false
  91. }
  92. [node name="GameOverPanel" type="Panel" parent="UI"]
  93. visible = false
  94. margin_left = 100.0
  95. margin_top = 175.0
  96. margin_right = 300.0
  97. margin_bottom = 225.0
  98. __meta__ = {
  99. "_edit_use_anchors_": false
  100. }
  101. [node name="GameOver" type="Label" parent="UI/GameOverPanel"]
  102. margin_left = -100.0
  103. margin_top = -175.0
  104. margin_right = 300.0
  105. margin_bottom = 225.0
  106. text = "Game Over"
  107. align = 1
  108. valign = 1
  109. [node name="TutorialPanel" type="Panel" parent="UI"]
  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="TutorialLabel" type="Label" parent="UI/TutorialPanel"]
  118. margin_left = -100.0
  119. margin_top = -175.0
  120. margin_right = 300.0
  121. margin_bottom = 225.0
  122. text = "Click to shoot a ball !"
  123. align = 1
  124. valign = 1
  125. [node name="ScoreCounter" parent="UI" instance=ExtResource( 6 )]
  126. margin_left = 350.0
  127. margin_top = 360.0
  128. margin_right = 390.0
  129. margin_bottom = 390.0
  130. title = "Score"
  131. [node name="BallCounter" parent="UI" instance=ExtResource( 6 )]
  132. margin_left = 10.0
  133. margin_top = 360.0
  134. margin_right = 50.0
  135. margin_bottom = 390.0
  136. title = "Balls"
  137. [connection signal="ready" from="." to="UI/BallCounter" method="increase_counter"]
  138. [connection signal="body_entered" from="Catcher" to="Catcher" method="_on_Catcher_body_entered"]
  139. [connection signal="game_over" from="Catcher" to="UI" method="_on_Catcher_game_over"]
  140. [connection signal="gain_new_bullet" from="Launcher" to="UI/BallCounter" method="increase_counter"]
  141. [connection signal="get_firing" from="Launcher" to="Launcher" method="_on_Launcher_get_firing"]
  142. [connection signal="get_firing" from="Launcher" to="UI" method="_on_Launcher_get_firing"]
  143. [connection signal="is_full" from="Launcher" to="Launcher/Grid" method="_on_Launcher_is_full"]
  144. [connection signal="move_visor" from="Launcher" to="Launcher/TargetLine" method="_on_Launcher_move_visor"]
  145. [connection signal="has_moved" from="Launcher/Grid" to="Launcher" method="_on_Grid_has_moved"]
  146. [connection signal="has_moved" from="Launcher/Grid" to="Launcher/DeadLine" method="_on_Grid_has_moved"]
  147. [connection signal="kace_broken" from="Launcher/Grid" to="Launcher" method="_on_Grid_kace_broken"]
  148. [connection signal="kace_damaged" from="Launcher/Grid" to="UI/ScoreCounter" method="increase_counter"]
  149. [connection signal="tween_all_completed" from="Launcher/Grid/MoveDown" to="Launcher/Grid" method="_on_MoveDown_tween_all_completed"]
  150. [connection signal="timeout" from="Launcher/ShootDelay" to="Launcher" method="_on_ShootDelay_timeout"]
  151. [connection signal="game_lost" from="Launcher/DeadLine" to="Launcher" method="_on_DeadLine_game_lost"]
  152. [connection signal="game_lost" from="Launcher/DeadLine" to="UI" method="_on_DeadLine_game_lost"]