main.tscn 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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="Walls" type="StaticBody2D" parent="."]
  39. physics_material_override = SubResource( 1 )
  40. [node name="Left" type="CollisionShape2D" parent="Walls"]
  41. position = Vector2( -50, 200 )
  42. shape = SubResource( 2 )
  43. [node name="Right" type="CollisionShape2D" parent="Walls"]
  44. position = Vector2( 450, 200 )
  45. shape = SubResource( 2 )
  46. [node name="Top" type="CollisionShape2D" parent="Walls"]
  47. position = Vector2( 200, -50 )
  48. shape = SubResource( 3 )
  49. [node name="Catcher" type="Area2D" parent="."]
  50. position = Vector2( 200, 460 )
  51. script = ExtResource( 3 )
  52. [node name="Area" type="CollisionShape2D" parent="Catcher"]
  53. shape = SubResource( 4 )
  54. [node name="Launcher" type="Node2D" parent="."]
  55. script = ExtResource( 4 )
  56. [node name="Grid" type="TileMap" parent="Launcher" groups=[
  57. "grid",
  58. ]]
  59. mode = 2
  60. tile_set = SubResource( 6 )
  61. cell_size = Vector2( 40, 20 )
  62. cell_custom_transform = Transform2D( 40, 0, 0, 20, 0, 0 )
  63. format = 1
  64. script = ExtResource( 6 )
  65. [node name="Target" type="Sprite" parent="Launcher"]
  66. position = Vector2( 200, 400 )
  67. texture = ExtResource( 5 )
  68. [node name="Source" type="Sprite" parent="Launcher"]
  69. position = Vector2( 200, 400 )
  70. texture = ExtResource( 1 )
  71. [node name="ShootDelay" type="Timer" parent="Launcher"]
  72. wait_time = 0.3
  73. one_shot = true
  74. [node name="UI" type="Control" parent="."]
  75. visible = false
  76. margin_right = 40.0
  77. margin_bottom = 40.0
  78. script = ExtResource( 7 )
  79. __meta__ = {
  80. "_edit_use_anchors_": false
  81. }
  82. [node name="Panel" type="Panel" parent="UI"]
  83. margin_left = 100.0
  84. margin_top = 175.0
  85. margin_right = 300.0
  86. margin_bottom = 225.0
  87. __meta__ = {
  88. "_edit_use_anchors_": false
  89. }
  90. [node name="GameOver" type="Label" parent="UI"]
  91. margin_right = 400.0
  92. margin_bottom = 400.0
  93. text = "Game Over"
  94. align = 1
  95. valign = 1
  96. [connection signal="body_entered" from="Catcher" to="Catcher" method="_on_Catcher_body_entered"]
  97. [connection signal="game_over" from="Catcher" to="UI" method="_on_Catcher_game_over"]
  98. [connection signal="get_firing" from="Launcher" to="Launcher" method="_on_Launcher_get_firing"]
  99. [connection signal="is_full" from="Launcher" to="Launcher/Grid" method="_on_Launcher_is_full"]
  100. [connection signal="has_moved" from="Launcher/Grid" to="Launcher" method="_on_Grid_has_moved"]
  101. [connection signal="kace_broken" from="Launcher/Grid" to="Launcher" method="_on_Grid_kace_broken"]
  102. [connection signal="timeout" from="Launcher/ShootDelay" to="Launcher" method="_on_ShootDelay_timeout"]