TimedBooBlock.tscn 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. [gd_scene load_steps=21 format=3 uid="uid://dgq7enviy1qhw"]
  2. [ext_resource type="Script" uid="uid://du5hnwdhv7x66" path="res://Scripts/Classes/Blocks/TimedBooBlock.gd" id="1_hessd"]
  3. [ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="3_5y3wt"]
  4. [ext_resource type="Script" uid="uid://caq1qiwmy0mox" path="res://Scripts/Parts/BetterAnimatedSprite.gd" id="3_7bqom"]
  5. [ext_resource type="Texture2D" uid="uid://bi13n4mw0to20" path="res://Assets/Sprites/Blocks/TimedBooBlock.png" id="3_46g6h"]
  6. [ext_resource type="JSON" path="res://Assets/Sprites/Blocks/TimedBooBlock.json" id="4_7bqom"]
  7. [ext_resource type="PackedScene" uid="uid://cijkvfkthetn5" path="res://Scenes/Parts/BlockAnimations.tscn" id="4_tgrgf"]
  8. [sub_resource type="AtlasTexture" id="AtlasTexture_slvan"]
  9. atlas = ExtResource("3_46g6h")
  10. region = Rect2(48, 16, 16, 16)
  11. [sub_resource type="AtlasTexture" id="AtlasTexture_mewnl"]
  12. atlas = ExtResource("3_46g6h")
  13. region = Rect2(64, 16, 16, 16)
  14. [sub_resource type="AtlasTexture" id="AtlasTexture_mcix7"]
  15. atlas = ExtResource("3_46g6h")
  16. region = Rect2(80, 16, 16, 16)
  17. [sub_resource type="AtlasTexture" id="AtlasTexture_mmpdk"]
  18. atlas = ExtResource("3_46g6h")
  19. region = Rect2(32, 16, 16, 16)
  20. [sub_resource type="AtlasTexture" id="AtlasTexture_n5dg2"]
  21. atlas = ExtResource("3_46g6h")
  22. region = Rect2(16, 16, 16, 16)
  23. [sub_resource type="AtlasTexture" id="AtlasTexture_ibap3"]
  24. atlas = ExtResource("3_46g6h")
  25. region = Rect2(0, 16, 16, 16)
  26. [sub_resource type="AtlasTexture" id="AtlasTexture_7gr33"]
  27. atlas = ExtResource("3_46g6h")
  28. region = Rect2(32, 0, 16, 16)
  29. [sub_resource type="AtlasTexture" id="AtlasTexture_2kb58"]
  30. atlas = ExtResource("3_46g6h")
  31. region = Rect2(16, 0, 16, 16)
  32. [sub_resource type="AtlasTexture" id="AtlasTexture_huvet"]
  33. atlas = ExtResource("3_46g6h")
  34. region = Rect2(0, 0, 16, 16)
  35. [sub_resource type="AtlasTexture" id="AtlasTexture_i3exc"]
  36. atlas = ExtResource("3_46g6h")
  37. region = Rect2(48, 0, 16, 16)
  38. [sub_resource type="AtlasTexture" id="AtlasTexture_r3ncx"]
  39. atlas = ExtResource("3_46g6h")
  40. region = Rect2(64, 0, 16, 16)
  41. [sub_resource type="AtlasTexture" id="AtlasTexture_8firs"]
  42. atlas = ExtResource("3_46g6h")
  43. region = Rect2(80, 0, 16, 16)
  44. [sub_resource type="SpriteFrames" id="SpriteFrames_7ajl0"]
  45. animations = [{
  46. "frames": [{
  47. "duration": 1.0,
  48. "texture": SubResource("AtlasTexture_slvan")
  49. }, {
  50. "duration": 1.0,
  51. "texture": SubResource("AtlasTexture_mewnl")
  52. }, {
  53. "duration": 1.0,
  54. "texture": SubResource("AtlasTexture_mcix7")
  55. }],
  56. "loop": false,
  57. "name": &"BlueToRed",
  58. "speed": 15.0
  59. }, {
  60. "frames": [{
  61. "duration": 1.0,
  62. "texture": SubResource("AtlasTexture_mmpdk")
  63. }],
  64. "loop": true,
  65. "name": &"Off1",
  66. "speed": 5.0
  67. }, {
  68. "frames": [{
  69. "duration": 1.0,
  70. "texture": SubResource("AtlasTexture_n5dg2")
  71. }],
  72. "loop": true,
  73. "name": &"Off2",
  74. "speed": 5.0
  75. }, {
  76. "frames": [{
  77. "duration": 1.0,
  78. "texture": SubResource("AtlasTexture_ibap3")
  79. }],
  80. "loop": true,
  81. "name": &"Off3",
  82. "speed": 5.0
  83. }, {
  84. "frames": [{
  85. "duration": 1.0,
  86. "texture": SubResource("AtlasTexture_7gr33")
  87. }],
  88. "loop": true,
  89. "name": &"On1",
  90. "speed": 5.0
  91. }, {
  92. "frames": [{
  93. "duration": 1.0,
  94. "texture": SubResource("AtlasTexture_2kb58")
  95. }],
  96. "loop": true,
  97. "name": &"On2",
  98. "speed": 5.0
  99. }, {
  100. "frames": [{
  101. "duration": 1.0,
  102. "texture": SubResource("AtlasTexture_huvet")
  103. }],
  104. "loop": true,
  105. "name": &"On3",
  106. "speed": 5.0
  107. }, {
  108. "frames": [{
  109. "duration": 1.0,
  110. "texture": SubResource("AtlasTexture_i3exc")
  111. }, {
  112. "duration": 1.0,
  113. "texture": SubResource("AtlasTexture_r3ncx")
  114. }, {
  115. "duration": 1.0,
  116. "texture": SubResource("AtlasTexture_8firs")
  117. }],
  118. "loop": false,
  119. "name": &"RedToBlue",
  120. "speed": 15.0
  121. }]
  122. [sub_resource type="RectangleShape2D" id="RectangleShape2D_ce8wa"]
  123. size = Vector2(16, 16)
  124. [node name="TimedBooBlock" type="AnimatableBody2D" node_paths=PackedStringArray("visuals") groups=["BooBlocks"]]
  125. collision_layer = 6
  126. script = ExtResource("1_hessd")
  127. visuals = NodePath("Sprite")
  128. destructable = false
  129. metadata/_custom_type_script = "uid://b5ejlbl0vp1gm"
  130. [node name="Sprite" type="AnimatedSprite2D" parent="."]
  131. sprite_frames = SubResource("SpriteFrames_7ajl0")
  132. animation = &"Off3"
  133. autoplay = "Off3"
  134. script = ExtResource("3_7bqom")
  135. do_offset = false
  136. metadata/_custom_type_script = "uid://caq1qiwmy0mox"
  137. [node name="ResourceSetterNew" type="Node" parent="Sprite" node_paths=PackedStringArray("node_to_affect")]
  138. script = ExtResource("3_5y3wt")
  139. node_to_affect = NodePath("..")
  140. property_name = "sprite_frames"
  141. resource_json = ExtResource("4_7bqom")
  142. metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
  143. [node name="CollisionShape2D" type="CollisionShape2D" parent="."]
  144. visible = false
  145. shape = SubResource("RectangleShape2D_ce8wa")
  146. [node name="Timer" type="Timer" parent="."]
  147. [node name="BlockAnimations" parent="." instance=ExtResource("4_tgrgf")]
  148. [connection signal="player_block_hit" from="." to="." method="block_hit" unbinds=1]
  149. [connection signal="player_block_hit" from="." to="BlockAnimations" method="bounce_block" unbinds=1]
  150. [connection signal="shell_block_hit" from="." to="." method="block_hit" unbinds=1]
  151. [connection signal="shell_block_hit" from="." to="BlockAnimations" method="bounce_block" unbinds=1]
  152. [connection signal="timeout" from="Timer" to="." method="on_timeout"]