OnOffFanRed.tscn 5.9 KB

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