main.tscn 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. [gd_scene load_steps=14 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. [sub_resource type="PhysicsMaterial" id=1]
  10. friction = 0.0
  11. bounce = 1.0
  12. [sub_resource type="RectangleShape2D" id=2]
  13. extents = Vector2( 50, 300 )
  14. [sub_resource type="RectangleShape2D" id=3]
  15. extents = Vector2( 300, 50 )
  16. [sub_resource type="RectangleShape2D" id=4]
  17. extents = Vector2( 200, 50 )
  18. [sub_resource type="ConvexPolygonShape2D" id=5]
  19. points = PoolVector2Array( 0, 0, 40, 0, 40, 20, 0, 20 )
  20. [sub_resource type="TileSet" id=6]
  21. 0/name = "brik.png 0"
  22. 0/texture = ExtResource( 2 )
  23. 0/tex_offset = Vector2( 0, 0 )
  24. 0/modulate = Color( 1, 1, 1, 1 )
  25. 0/region = Rect2( 0, 0, 40, 20 )
  26. 0/tile_mode = 0
  27. 0/occluder_offset = Vector2( 0, 0 )
  28. 0/navigation_offset = Vector2( 0, 0 )
  29. 0/shapes = [ {
  30. "autotile_coord": Vector2( 0, 0 ),
  31. "one_way": false,
  32. "one_way_margin": 1.0,
  33. "shape": SubResource( 5 ),
  34. "shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
  35. } ]
  36. 0/z_index = 0
  37. [node name="Root" type="Node"]
  38. [node name="Background" type="Panel" parent="."]
  39. margin_right = 400.0
  40. margin_bottom = 400.0
  41. __meta__ = {
  42. "_edit_use_anchors_": false
  43. }
  44. [node name="Walls" type="StaticBody2D" parent="."]
  45. collision_layer = 2
  46. physics_material_override = SubResource( 1 )
  47. [node name="Left" type="CollisionShape2D" parent="Walls"]
  48. position = Vector2( -50, 200 )
  49. shape = SubResource( 2 )
  50. [node name="Right" type="CollisionShape2D" parent="Walls"]
  51. position = Vector2( 450, 200 )
  52. shape = SubResource( 2 )
  53. [node name="Top" type="CollisionShape2D" parent="Walls"]
  54. position = Vector2( 200, -50 )
  55. shape = SubResource( 3 )
  56. [node name="Catcher" type="Area2D" parent="."]
  57. position = Vector2( 200, 460 )
  58. collision_layer = 8
  59. collision_mask = 5
  60. script = ExtResource( 3 )
  61. [node name="Area" type="CollisionShape2D" parent="Catcher"]
  62. shape = SubResource( 4 )
  63. [node name="Launcher" type="Node2D" parent="."]
  64. script = ExtResource( 4 )
  65. [node name="Grid" type="TileMap" parent="Launcher" groups=[
  66. "grid",
  67. ]]
  68. mode = 2
  69. tile_set = SubResource( 6 )
  70. cell_size = Vector2( 40, 20 )
  71. cell_custom_transform = Transform2D( 40, 0, 0, 20, 0, 0 )
  72. collision_layer = 4
  73. collision_mask = 9
  74. format = 1
  75. script = ExtResource( 6 )
  76. [node name="Target" type="Sprite" parent="Launcher"]
  77. position = Vector2( 200, 400 )
  78. texture = ExtResource( 5 )
  79. [node name="Source" type="Sprite" parent="Launcher"]
  80. position = Vector2( 200, 400 )
  81. texture = ExtResource( 1 )
  82. [node name="ShootDelay" type="Timer" parent="Launcher"]
  83. wait_time = 0.1
  84. one_shot = true
  85. [node name="UI" type="Control" parent="."]
  86. visible = false
  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="Panel" type="Panel" parent="UI"]
  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"]
  102. margin_right = 400.0
  103. margin_bottom = 400.0
  104. text = "Game Over"
  105. align = 1
  106. valign = 1
  107. [connection signal="body_entered" from="Catcher" to="Catcher" method="_on_Catcher_body_entered"]
  108. [connection signal="game_over" from="Catcher" to="UI" method="_on_Catcher_game_over"]
  109. [connection signal="get_firing" from="Launcher" to="Launcher" method="_on_Launcher_get_firing"]
  110. [connection signal="is_full" from="Launcher" to="Launcher/Grid" method="_on_Launcher_is_full"]
  111. [connection signal="has_moved" from="Launcher/Grid" to="Launcher" method="_on_Grid_has_moved"]
  112. [connection signal="kace_broken" from="Launcher/Grid" to="Launcher" method="_on_Grid_kace_broken"]
  113. [connection signal="timeout" from="Launcher/ShootDelay" to="Launcher" method="_on_ShootDelay_timeout"]