BooOnOffBlock.tscn 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. [gd_scene load_steps=21 format=3 uid="uid://by6ndsjhlkmbt"]
  2. [ext_resource type="Texture2D" uid="uid://coe8j7vfyvmh8" path="res://Assets/Sprites/Blocks/BooOnOffBlock.png" id="1_j75mb"]
  3. [ext_resource type="Script" uid="uid://be2x40pxmueyo" path="res://Scripts/Classes/Blocks/BooOnOffBlock.gd" id="1_mttsc"]
  4. [ext_resource type="Script" uid="uid://cnheej0sxmoxg" path="res://Scripts/Parts/PlayerDetection.gd" id="3_ds5j0"]
  5. [ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="3_sf1e4"]
  6. [ext_resource type="JSON" path="res://Assets/Sprites/Blocks/BooOnOffBlockRed.json" id="4_ofstd"]
  7. [ext_resource type="Script" uid="uid://d4a7yp6e55u8t" path="res://Scripts/Classes/Components/TrackJoint.gd" id="6_y6qjl"]
  8. [sub_resource type="AtlasTexture" id="AtlasTexture_mttsc"]
  9. atlas = ExtResource("1_j75mb")
  10. region = Rect2(64, 0, 16, 16)
  11. [sub_resource type="AtlasTexture" id="AtlasTexture_ds5j0"]
  12. atlas = ExtResource("1_j75mb")
  13. region = Rect2(0, 0, 16, 16)
  14. [sub_resource type="AtlasTexture" id="AtlasTexture_wpfka"]
  15. atlas = ExtResource("1_j75mb")
  16. region = Rect2(16, 0, 16, 16)
  17. [sub_resource type="AtlasTexture" id="AtlasTexture_ejjud"]
  18. atlas = ExtResource("1_j75mb")
  19. region = Rect2(32, 0, 16, 16)
  20. [sub_resource type="AtlasTexture" id="AtlasTexture_iufm8"]
  21. atlas = ExtResource("1_j75mb")
  22. region = Rect2(48, 0, 16, 16)
  23. [sub_resource type="AtlasTexture" id="AtlasTexture_ly3ab"]
  24. atlas = ExtResource("1_j75mb")
  25. region = Rect2(64, 0, 16, 16)
  26. [sub_resource type="AtlasTexture" id="AtlasTexture_b85kh"]
  27. atlas = ExtResource("1_j75mb")
  28. region = Rect2(64, 0, 16, 16)
  29. [sub_resource type="AtlasTexture" id="AtlasTexture_3r05r"]
  30. atlas = ExtResource("1_j75mb")
  31. region = Rect2(80, 0, 16, 16)
  32. [sub_resource type="AtlasTexture" id="AtlasTexture_vqjxh"]
  33. atlas = ExtResource("1_j75mb")
  34. region = Rect2(96, 0, 16, 16)
  35. [sub_resource type="AtlasTexture" id="AtlasTexture_374u5"]
  36. atlas = ExtResource("1_j75mb")
  37. region = Rect2(112, 0, 16, 16)
  38. [sub_resource type="AtlasTexture" id="AtlasTexture_qg086"]
  39. atlas = ExtResource("1_j75mb")
  40. region = Rect2(0, 0, 16, 16)
  41. [sub_resource type="SpriteFrames" id="SpriteFrames_xp1gv"]
  42. animations = [{
  43. "frames": [{
  44. "duration": 1.0,
  45. "texture": SubResource("AtlasTexture_mttsc")
  46. }],
  47. "loop": true,
  48. "name": &"Default",
  49. "speed": 5.0
  50. }, {
  51. "frames": [{
  52. "duration": 1.0,
  53. "texture": SubResource("AtlasTexture_ds5j0")
  54. }, {
  55. "duration": 1.0,
  56. "texture": SubResource("AtlasTexture_wpfka")
  57. }, {
  58. "duration": 1.0,
  59. "texture": SubResource("AtlasTexture_ejjud")
  60. }, {
  61. "duration": 1.0,
  62. "texture": SubResource("AtlasTexture_iufm8")
  63. }, {
  64. "duration": 1.0,
  65. "texture": SubResource("AtlasTexture_ly3ab")
  66. }],
  67. "loop": false,
  68. "name": &"Off",
  69. "speed": 15.0
  70. }, {
  71. "frames": [{
  72. "duration": 1.0,
  73. "texture": SubResource("AtlasTexture_b85kh")
  74. }, {
  75. "duration": 1.0,
  76. "texture": SubResource("AtlasTexture_3r05r")
  77. }, {
  78. "duration": 1.0,
  79. "texture": SubResource("AtlasTexture_vqjxh")
  80. }, {
  81. "duration": 1.0,
  82. "texture": SubResource("AtlasTexture_374u5")
  83. }, {
  84. "duration": 1.0,
  85. "texture": SubResource("AtlasTexture_qg086")
  86. }],
  87. "loop": false,
  88. "name": &"On",
  89. "speed": 15.0
  90. }]
  91. [sub_resource type="RectangleShape2D" id="RectangleShape2D_fe1rr"]
  92. size = Vector2(16, 16)
  93. [sub_resource type="RectangleShape2D" id="RectangleShape2D_ds5j0"]
  94. size = Vector2(12, 12)
  95. [node name="BooOnOffBlock" type="AnimatableBody2D" groups=["BooBlocks"]]
  96. collision_layer = 6
  97. collision_mask = 0
  98. sync_to_physics = false
  99. script = ExtResource("1_mttsc")
  100. [node name="Sprite" type="AnimatedSprite2D" parent="."]
  101. sprite_frames = SubResource("SpriteFrames_xp1gv")
  102. animation = &"Default"
  103. autoplay = "Default"
  104. [node name="ResourceSetter" type="Node" parent="Sprite" node_paths=PackedStringArray("node_to_affect")]
  105. script = ExtResource("3_sf1e4")
  106. node_to_affect = NodePath("..")
  107. property_name = "sprite_frames"
  108. resource_json = ExtResource("4_ofstd")
  109. metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
  110. [node name="Collision" type="CollisionShape2D" parent="."]
  111. visible = false
  112. shape = SubResource("RectangleShape2D_fe1rr")
  113. disabled = true
  114. [node name="PlayerDetection" type="Area2D" parent="."]
  115. visible = false
  116. script = ExtResource("3_ds5j0")
  117. metadata/_custom_type_script = "uid://cnheej0sxmoxg"
  118. [node name="CollisionShape2D" type="CollisionShape2D" parent="PlayerDetection"]
  119. shape = SubResource("RectangleShape2D_ds5j0")
  120. [node name="TrackJoint" type="Node" parent="."]
  121. script = ExtResource("6_y6qjl")
  122. offset = Vector2(0, 0)
  123. metadata/_custom_type_script = "uid://d4a7yp6e55u8t"
  124. [connection signal="player_entered" from="PlayerDetection" to="." method="on_player_entered"]
  125. [connection signal="player_exited" from="PlayerDetection" to="." method="on_player_exited"]