Fan.tscn 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. [gd_scene load_steps=22 format=3 uid="uid://svkvxdk8fsyj"]
  2. [ext_resource type="Script" uid="uid://bvplls3ae0oqr" path="res://Scripts/Classes/Entities/Objects/OnOffFanRed.gd" id="1_lggcr"]
  3. [ext_resource type="Texture2D" uid="uid://dkwk6x3je28oi" path="res://Assets/Sprites/Blocks/Fan.png" id="2_lggcr"]
  4. [ext_resource type="Script" uid="uid://caq1qiwmy0mox" path="res://Scripts/Parts/BetterAnimatedSprite.gd" id="3_shbxw"]
  5. [ext_resource type="Texture2D" uid="uid://dy3p03djelkb3" path="res://Assets/Sprites/Particles/Leaves.png" id="4_3g67n"]
  6. [ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="5_254o8"]
  7. [ext_resource type="JSON" path="res://Assets/Sprites/Blocks/Fan.json" id="5_lkjwe"]
  8. [ext_resource type="JSON" path="res://Assets/Sprites/Particles/WindParticles.json" id="6_vnvew"]
  9. [ext_resource type="Script" uid="uid://ctfbuoxtnnl0q" path="res://Scripts/Classes/Components/EditorPropertyExposer.gd" id="7_cdvdi"]
  10. [ext_resource type="Script" uid="uid://d4a7yp6e55u8t" path="res://Scripts/Classes/Components/TrackJoint.gd" id="8_yp1rr"]
  11. [sub_resource type="AtlasTexture" id="AtlasTexture_lkjwe"]
  12. atlas = ExtResource("2_lggcr")
  13. region = Rect2(0, 0, 16, 48)
  14. [sub_resource type="AtlasTexture" id="AtlasTexture_shbxw"]
  15. atlas = ExtResource("2_lggcr")
  16. region = Rect2(16, 0, 16, 48)
  17. [sub_resource type="AtlasTexture" id="AtlasTexture_3g67n"]
  18. atlas = ExtResource("2_lggcr")
  19. region = Rect2(32, 0, 16, 48)
  20. [sub_resource type="AtlasTexture" id="AtlasTexture_254o8"]
  21. atlas = ExtResource("2_lggcr")
  22. region = Rect2(48, 0, 16, 48)
  23. [sub_resource type="SpriteFrames" id="SpriteFrames_vnvew"]
  24. animations = [{
  25. "frames": [{
  26. "duration": 1.0,
  27. "texture": SubResource("AtlasTexture_lkjwe")
  28. }, {
  29. "duration": 1.0,
  30. "texture": SubResource("AtlasTexture_shbxw")
  31. }, {
  32. "duration": 1.0,
  33. "texture": SubResource("AtlasTexture_3g67n")
  34. }, {
  35. "duration": 1.0,
  36. "texture": SubResource("AtlasTexture_254o8")
  37. }],
  38. "loop": true,
  39. "name": &"On",
  40. "speed": 30.0
  41. }]
  42. [sub_resource type="RectangleShape2D" id="RectangleShape2D_wvrj8"]
  43. size = Vector2(16, 48)
  44. [sub_resource type="RectangleShape2D" id="RectangleShape2D_4qr7a"]
  45. size = Vector2(256, 36)
  46. [sub_resource type="CanvasItemMaterial" id="CanvasItemMaterial_wo6ri"]
  47. particles_animation = true
  48. particles_anim_h_frames = 2
  49. particles_anim_v_frames = 1
  50. particles_anim_loop = false
  51. [sub_resource type="Curve" id="Curve_56hbg"]
  52. _data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(0.894444, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
  53. point_count = 3
  54. [sub_resource type="CurveTexture" id="CurveTexture_8c2la"]
  55. curve = SubResource("Curve_56hbg")
  56. [sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_ixtv2"]
  57. particle_flag_disable_z = true
  58. emission_shape_scale = Vector3(1, 15, 1)
  59. emission_shape = 3
  60. emission_box_extents = Vector3(1, 1, 1)
  61. spread = 0.0
  62. initial_velocity_min = 100.0
  63. initial_velocity_max = 500.0
  64. angular_velocity_min = -720.0
  65. angular_velocity_max = 720.0
  66. gravity = Vector3(0, 0, 0)
  67. alpha_curve = SubResource("CurveTexture_8c2la")
  68. anim_offset_max = 1.0
  69. [sub_resource type="GDScript" id="GDScript_gfuw1"]
  70. script/source = "extends Node
  71. @export var sprite: AnimatedSprite2D = null
  72. func _process(_delta: float) -> void:
  73. $\"..\".global_rotation_degrees = [0, 180, -90, 90][owner.direction]
  74. sprite.global_rotation_degrees = [0, 0, 90, 90][owner.direction]
  75. sprite.flip_h = owner.direction == 1 or owner.direction == 2
  76. "
  77. [node name="Fan" type="AnimatableBody2D"]
  78. collision_layer = 6
  79. collision_mask = 0
  80. sync_to_physics = false
  81. script = ExtResource("1_lggcr")
  82. active = true
  83. [node name="RotationJoint" type="Node2D" parent="."]
  84. [node name="Sprite" type="AnimatedSprite2D" parent="."]
  85. sprite_frames = SubResource("SpriteFrames_vnvew")
  86. animation = &"On"
  87. autoplay = "On"
  88. frame_progress = 0.9855531
  89. script = ExtResource("3_shbxw")
  90. do_offset = false
  91. metadata/_custom_type_script = "uid://caq1qiwmy0mox"
  92. [node name="ResourceSetterNew" type="Node" parent="Sprite" node_paths=PackedStringArray("node_to_affect")]
  93. script = ExtResource("5_254o8")
  94. node_to_affect = NodePath("..")
  95. property_name = "sprite_frames"
  96. resource_json = ExtResource("5_lkjwe")
  97. metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
  98. [node name="Collision" type="CollisionShape2D" parent="."]
  99. shape = SubResource("RectangleShape2D_wvrj8")
  100. [node name="Hitbox" type="Area2D" parent="."]
  101. [node name="Shape" type="CollisionShape2D" parent="Hitbox"]
  102. position = Vector2(128, 0)
  103. shape = SubResource("RectangleShape2D_4qr7a")
  104. [node name="Particles" type="GPUParticles2D" parent="."]
  105. unique_name_in_owner = true
  106. material = SubResource("CanvasItemMaterial_wo6ri")
  107. emitting = false
  108. texture = ExtResource("4_3g67n")
  109. lifetime = 0.5
  110. process_material = SubResource("ParticleProcessMaterial_ixtv2")
  111. [node name="ResourceSetterNew" type="Node" parent="Particles" node_paths=PackedStringArray("node_to_affect")]
  112. script = ExtResource("5_254o8")
  113. node_to_affect = NodePath("..")
  114. property_name = "texture"
  115. mode = 1
  116. resource_json = ExtResource("6_vnvew")
  117. metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
  118. [node name="Node" type="Node" parent="." node_paths=PackedStringArray("sprite")]
  119. process_mode = 3
  120. script = SubResource("GDScript_gfuw1")
  121. sprite = NodePath("../Sprite")
  122. [node name="EditorPropertyExposer" type="Node" parent="."]
  123. script = ExtResource("7_cdvdi")
  124. properties = Array[String](["direction", "strength"])
  125. metadata/_custom_type_script = "uid://ctfbuoxtnnl0q"
  126. [node name="TrackJoint" type="Node" parent="."]
  127. script = ExtResource("8_yp1rr")
  128. offset = Vector2(0, 0)
  129. disable_physics = false
  130. metadata/_custom_type_script = "uid://d4a7yp6e55u8t"
  131. [node name="RemoteTransform2D" type="RemoteTransform2D" parent="."]
  132. remote_path = NodePath("../Sprite")
  133. update_rotation = false
  134. update_scale = false