main.tscn 4.5 KB

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