KeyItem.tscn 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. [gd_scene load_steps=18 format=3 uid="uid://ny5glffi0suh"]
  2. [ext_resource type="Texture2D" uid="uid://bagrao4ahra76" path="res://Assets/Sprites/Items/Key.png" id="1_883rn"]
  3. [ext_resource type="Script" uid="uid://cjgbt7iof66j0" path="res://Scripts/Classes/Entities/Items/KeyItem.gd" id="1_l02ex"]
  4. [ext_resource type="Script" uid="uid://caq1qiwmy0mox" path="res://Scripts/Parts/BetterAnimatedSprite.gd" id="2_ecusj"]
  5. [ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="3_l02ex"]
  6. [ext_resource type="Script" uid="uid://cnheej0sxmoxg" path="res://Scripts/Parts/PlayerDetection.gd" id="3_m8uts"]
  7. [ext_resource type="JSON" path="res://Assets/Sprites/Items/Key.json" id="4_m8uts"]
  8. [ext_resource type="Texture2D" uid="uid://sgrcmlktp2dk" path="res://Assets/Sprites/Particles/SRankParticles.png" id="7_2yl70"]
  9. [sub_resource type="AtlasTexture" id="AtlasTexture_l02ex"]
  10. atlas = ExtResource("1_883rn")
  11. region = Rect2(0, 0, 16, 16)
  12. [sub_resource type="AtlasTexture" id="AtlasTexture_2yl70"]
  13. atlas = ExtResource("1_883rn")
  14. region = Rect2(16, 0, 16, 16)
  15. [sub_resource type="AtlasTexture" id="AtlasTexture_imihh"]
  16. atlas = ExtResource("1_883rn")
  17. region = Rect2(32, 0, 16, 16)
  18. [sub_resource type="SpriteFrames" id="SpriteFrames_rls2x"]
  19. animations = [{
  20. "frames": [{
  21. "duration": 1.0,
  22. "texture": SubResource("AtlasTexture_l02ex")
  23. }, {
  24. "duration": 1.0,
  25. "texture": SubResource("AtlasTexture_l02ex")
  26. }, {
  27. "duration": 1.0,
  28. "texture": SubResource("AtlasTexture_l02ex")
  29. }, {
  30. "duration": 1.0,
  31. "texture": SubResource("AtlasTexture_l02ex")
  32. }, {
  33. "duration": 1.0,
  34. "texture": SubResource("AtlasTexture_l02ex")
  35. }, {
  36. "duration": 1.0,
  37. "texture": SubResource("AtlasTexture_l02ex")
  38. }, {
  39. "duration": 1.0,
  40. "texture": SubResource("AtlasTexture_l02ex")
  41. }, {
  42. "duration": 1.0,
  43. "texture": SubResource("AtlasTexture_l02ex")
  44. }, {
  45. "duration": 1.0,
  46. "texture": SubResource("AtlasTexture_l02ex")
  47. }, {
  48. "duration": 1.0,
  49. "texture": SubResource("AtlasTexture_l02ex")
  50. }, {
  51. "duration": 1.0,
  52. "texture": SubResource("AtlasTexture_2yl70")
  53. }, {
  54. "duration": 1.0,
  55. "texture": SubResource("AtlasTexture_imihh")
  56. }, {
  57. "duration": 1.0,
  58. "texture": SubResource("AtlasTexture_2yl70")
  59. }],
  60. "loop": true,
  61. "name": &"default",
  62. "speed": 10.0
  63. }]
  64. [sub_resource type="RectangleShape2D" id="RectangleShape2D_2u37r"]
  65. size = Vector2(12, 12)
  66. [sub_resource type="Animation" id="Animation_d4wb4"]
  67. resource_name = "Float"
  68. length = 2.0
  69. loop_mode = 1
  70. tracks/0/type = "value"
  71. tracks/0/imported = false
  72. tracks/0/enabled = true
  73. tracks/0/path = NodePath("Sprite:offset")
  74. tracks/0/interp = 2
  75. tracks/0/loop_wrap = true
  76. tracks/0/keys = {
  77. "times": PackedFloat32Array(0, 1),
  78. "transitions": PackedFloat32Array(1, 1),
  79. "update": 0,
  80. "values": [Vector2(0, 0), Vector2(0, -2)]
  81. }
  82. [sub_resource type="Animation" id="Animation_1rbaj"]
  83. length = 0.001
  84. tracks/0/type = "value"
  85. tracks/0/imported = false
  86. tracks/0/enabled = true
  87. tracks/0/path = NodePath("Sprite:offset")
  88. tracks/0/interp = 1
  89. tracks/0/loop_wrap = true
  90. tracks/0/keys = {
  91. "times": PackedFloat32Array(0),
  92. "transitions": PackedFloat32Array(1),
  93. "update": 0,
  94. "values": [Vector2(0, 0)]
  95. }
  96. [sub_resource type="AnimationLibrary" id="AnimationLibrary_e440m"]
  97. _data = {
  98. &"Float": SubResource("Animation_d4wb4"),
  99. &"RESET": SubResource("Animation_1rbaj")
  100. }
  101. [sub_resource type="CanvasItemMaterial" id="CanvasItemMaterial_imihh"]
  102. particles_animation = true
  103. particles_anim_h_frames = 7
  104. particles_anim_v_frames = 1
  105. particles_anim_loop = false
  106. [sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_rls2x"]
  107. particle_flag_disable_z = true
  108. emission_shape = 6
  109. emission_ring_axis = Vector3(0, 0, 1)
  110. emission_ring_height = 8.0
  111. emission_ring_radius = 10.0
  112. emission_ring_inner_radius = 8.0
  113. emission_ring_cone_angle = 90.0
  114. gravity = Vector3(0, 0, 0)
  115. anim_speed_min = 2.0
  116. anim_speed_max = 2.0
  117. [node name="KeyItem" type="Node2D"]
  118. script = ExtResource("1_l02ex")
  119. [node name="Sprite" type="AnimatedSprite2D" parent="."]
  120. position = Vector2(0, -8)
  121. sprite_frames = SubResource("SpriteFrames_rls2x")
  122. autoplay = "default"
  123. frame_progress = 0.18760097
  124. script = ExtResource("2_ecusj")
  125. metadata/_custom_type_script = "uid://caq1qiwmy0mox"
  126. [node name="ResourceSetterNew" type="Node" parent="Sprite" node_paths=PackedStringArray("node_to_affect")]
  127. script = ExtResource("3_l02ex")
  128. node_to_affect = NodePath("..")
  129. property_name = "sprite_frames"
  130. resource_json = ExtResource("4_m8uts")
  131. metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
  132. [node name="Hitbox" type="Area2D" parent="."]
  133. position = Vector2(0, -8)
  134. script = ExtResource("3_m8uts")
  135. metadata/_custom_type_script = "uid://cnheej0sxmoxg"
  136. [node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"]
  137. shape = SubResource("RectangleShape2D_2u37r")
  138. [node name="AnimationPlayer" type="AnimationPlayer" parent="."]
  139. libraries = {
  140. &"": SubResource("AnimationLibrary_e440m")
  141. }
  142. [node name="GoldParticles" type="GPUParticles2D" parent="."]
  143. z_index = 1
  144. material = SubResource("CanvasItemMaterial_imihh")
  145. position = Vector2(0, -8)
  146. amount = 1
  147. texture = ExtResource("7_2yl70")
  148. randomness = 0.12
  149. process_material = SubResource("ParticleProcessMaterial_rls2x")
  150. [connection signal="player_entered" from="Hitbox" to="." method="collected" unbinds=1]