BooOnOffSwitch.tscn 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. [gd_scene load_steps=19 format=3 uid="uid://5ua3p0lfl1bf"]
  2. [ext_resource type="Script" uid="uid://bm72ggve5kda5" path="res://Scripts/Classes/Blocks/BooOnOffSwitch.gd" id="1_ldgc7"]
  3. [ext_resource type="Texture2D" uid="uid://b00h2ocjft42e" path="res://Assets/Sprites/Blocks/BooOnOffSwitch.png" id="2_b0kgh"]
  4. [ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="3_afw5n"]
  5. [ext_resource type="PackedScene" uid="uid://cijkvfkthetn5" path="res://Scenes/Parts/BlockAnimations.tscn" id="3_b0kgh"]
  6. [ext_resource type="JSON" path="res://Assets/Sprites/Blocks/BooOnOffSwitch.json" id="4_bllja"]
  7. [sub_resource type="AtlasTexture" id="AtlasTexture_yh77s"]
  8. atlas = ExtResource("2_b0kgh")
  9. region = Rect2(0, 0, 16, 16)
  10. [sub_resource type="AtlasTexture" id="AtlasTexture_ldgc7"]
  11. atlas = ExtResource("2_b0kgh")
  12. region = Rect2(0, 16, 16, 16)
  13. [sub_resource type="AtlasTexture" id="AtlasTexture_mcsv7"]
  14. atlas = ExtResource("2_b0kgh")
  15. region = Rect2(16, 16, 16, 16)
  16. [sub_resource type="AtlasTexture" id="AtlasTexture_60tvi"]
  17. atlas = ExtResource("2_b0kgh")
  18. region = Rect2(32, 16, 16, 16)
  19. [sub_resource type="AtlasTexture" id="AtlasTexture_f7t61"]
  20. atlas = ExtResource("2_b0kgh")
  21. region = Rect2(48, 16, 16, 16)
  22. [sub_resource type="AtlasTexture" id="AtlasTexture_hbxxr"]
  23. atlas = ExtResource("2_b0kgh")
  24. region = Rect2(0, 0, 16, 16)
  25. [sub_resource type="AtlasTexture" id="AtlasTexture_h8ett"]
  26. atlas = ExtResource("2_b0kgh")
  27. region = Rect2(0, 0, 16, 16)
  28. [sub_resource type="AtlasTexture" id="AtlasTexture_ykmgv"]
  29. atlas = ExtResource("2_b0kgh")
  30. region = Rect2(16, 0, 16, 16)
  31. [sub_resource type="AtlasTexture" id="AtlasTexture_whks1"]
  32. atlas = ExtResource("2_b0kgh")
  33. region = Rect2(32, 0, 16, 16)
  34. [sub_resource type="AtlasTexture" id="AtlasTexture_la0ug"]
  35. atlas = ExtResource("2_b0kgh")
  36. region = Rect2(48, 0, 16, 16)
  37. [sub_resource type="AtlasTexture" id="AtlasTexture_dxm0r"]
  38. atlas = ExtResource("2_b0kgh")
  39. region = Rect2(0, 16, 16, 16)
  40. [sub_resource type="SpriteFrames" id="SpriteFrames_yh77s"]
  41. animations = [{
  42. "frames": [{
  43. "duration": 1.0,
  44. "texture": SubResource("AtlasTexture_yh77s")
  45. }],
  46. "loop": true,
  47. "name": &"Default",
  48. "speed": 5.0
  49. }, {
  50. "frames": [{
  51. "duration": 1.0,
  52. "texture": SubResource("AtlasTexture_ldgc7")
  53. }, {
  54. "duration": 1.0,
  55. "texture": SubResource("AtlasTexture_mcsv7")
  56. }, {
  57. "duration": 1.0,
  58. "texture": SubResource("AtlasTexture_60tvi")
  59. }, {
  60. "duration": 1.0,
  61. "texture": SubResource("AtlasTexture_f7t61")
  62. }, {
  63. "duration": 1.0,
  64. "texture": SubResource("AtlasTexture_hbxxr")
  65. }],
  66. "loop": false,
  67. "name": &"Off",
  68. "speed": 15.0
  69. }, {
  70. "frames": [{
  71. "duration": 1.0,
  72. "texture": SubResource("AtlasTexture_h8ett")
  73. }, {
  74. "duration": 1.0,
  75. "texture": SubResource("AtlasTexture_ykmgv")
  76. }, {
  77. "duration": 1.0,
  78. "texture": SubResource("AtlasTexture_whks1")
  79. }, {
  80. "duration": 1.0,
  81. "texture": SubResource("AtlasTexture_la0ug")
  82. }, {
  83. "duration": 1.0,
  84. "texture": SubResource("AtlasTexture_dxm0r")
  85. }],
  86. "loop": false,
  87. "name": &"On",
  88. "speed": 15.0
  89. }]
  90. [sub_resource type="RectangleShape2D" id="RectangleShape2D_uwq65"]
  91. size = Vector2(16, 16)
  92. [node name="BooOnOffSwitch" type="AnimatableBody2D" node_paths=PackedStringArray("visuals") groups=["BooBlocks", "BooSwitchBlocks"]]
  93. collision_layer = 6
  94. collision_mask = 0
  95. script = ExtResource("1_ldgc7")
  96. visuals = NodePath("Sprite")
  97. metadata/_custom_type_script = "uid://b5ejlbl0vp1gm"
  98. [node name="Sprite" type="AnimatedSprite2D" parent="."]
  99. sprite_frames = SubResource("SpriteFrames_yh77s")
  100. animation = &"On"
  101. autoplay = "Default"
  102. [node name="ResourceSetter" type="Node" parent="Sprite" node_paths=PackedStringArray("node_to_affect")]
  103. script = ExtResource("3_afw5n")
  104. node_to_affect = NodePath("..")
  105. property_name = "sprite_frames"
  106. resource_json = ExtResource("4_bllja")
  107. metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
  108. [node name="Collision" type="CollisionShape2D" parent="."]
  109. visible = false
  110. shape = SubResource("RectangleShape2D_uwq65")
  111. [node name="BlockAnimations" parent="." instance=ExtResource("3_b0kgh")]
  112. [connection signal="player_block_hit" from="." to="." method="on_block_hit" unbinds=1]
  113. [connection signal="player_block_hit" from="." to="BlockAnimations" method="bounce_block" unbinds=1]