main.tscn 5.5 KB

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