SpinningTurnBlock.tscn 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. [gd_scene load_steps=12 format=3 uid="uid://b8dalotrk2oci"]
  2. [ext_resource type="Texture2D" uid="uid://btt618edhifoj" path="res://Assets/Sprites/Blocks/TurnBlock.png" id="1_fh7wk"]
  3. [ext_resource type="Script" uid="uid://7evxxqgv6e3j" path="res://Scripts/Classes/Blocks/SpinningTurnBlock.gd" id="2_aiilm"]
  4. [ext_resource type="Script" uid="uid://caq1qiwmy0mox" path="res://Scripts/Parts/BetterAnimatedSprite.gd" id="3_aiilm"]
  5. [ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="4_pd7sm"]
  6. [ext_resource type="JSON" path="res://Assets/Sprites/Blocks/TurnBlock.json" id="5_gaxhp"]
  7. [sub_resource type="AtlasTexture" id="AtlasTexture_8yy4r"]
  8. atlas = ExtResource("1_fh7wk")
  9. region = Rect2(0, 0, 16, 16)
  10. [sub_resource type="AtlasTexture" id="AtlasTexture_pm24u"]
  11. atlas = ExtResource("1_fh7wk")
  12. region = Rect2(16, 0, 16, 16)
  13. [sub_resource type="AtlasTexture" id="AtlasTexture_keywi"]
  14. atlas = ExtResource("1_fh7wk")
  15. region = Rect2(32, 0, 16, 16)
  16. [sub_resource type="AtlasTexture" id="AtlasTexture_2j2lx"]
  17. atlas = ExtResource("1_fh7wk")
  18. region = Rect2(48, 0, 16, 16)
  19. [sub_resource type="SpriteFrames" id="SpriteFrames_rksv1"]
  20. animations = [{
  21. "frames": [{
  22. "duration": 1.0,
  23. "texture": SubResource("AtlasTexture_8yy4r")
  24. }, {
  25. "duration": 1.0,
  26. "texture": SubResource("AtlasTexture_pm24u")
  27. }, {
  28. "duration": 1.0,
  29. "texture": SubResource("AtlasTexture_keywi")
  30. }, {
  31. "duration": 1.0,
  32. "texture": SubResource("AtlasTexture_2j2lx")
  33. }],
  34. "loop": true,
  35. "name": &"default",
  36. "speed": 10.0
  37. }]
  38. [sub_resource type="RectangleShape2D" id="RectangleShape2D_fh7wk"]
  39. size = Vector2(16, 16)
  40. [node name="SpinningTurnBlock" type="Node2D"]
  41. z_index = -1
  42. script = ExtResource("2_aiilm")
  43. [node name="Sprite" type="AnimatedSprite2D" parent="."]
  44. sprite_frames = SubResource("SpriteFrames_rksv1")
  45. autoplay = "default"
  46. frame = 1
  47. script = ExtResource("3_aiilm")
  48. do_offset = false
  49. metadata/_custom_type_script = "uid://caq1qiwmy0mox"
  50. [node name="ResourceSetterNew" type="Node" parent="Sprite" node_paths=PackedStringArray("node_to_affect")]
  51. script = ExtResource("4_pd7sm")
  52. node_to_affect = NodePath("..")
  53. property_name = "sprite_frames"
  54. resource_json = ExtResource("5_gaxhp")
  55. metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
  56. [node name="Timer" type="Timer" parent="."]
  57. wait_time = 5.0
  58. one_shot = true
  59. autostart = true
  60. [node name="PlayerDetectionArea" type="Area2D" parent="."]
  61. [node name="CollisionShape2D" type="CollisionShape2D" parent="PlayerDetectionArea"]
  62. shape = SubResource("RectangleShape2D_fh7wk")
  63. [connection signal="timeout" from="Timer" to="." method="on_timeout"]