ClockItem.tscn 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. [gd_scene load_steps=16 format=3 uid="uid://rruc6lnk16rr"]
  2. [ext_resource type="Script" uid="uid://dryofl8epgget" path="res://Scripts/Classes/Entities/Items/ClockItem.gd" id="1_heiyr"]
  3. [ext_resource type="Texture2D" uid="uid://dal8md4ms07j2" path="res://Assets/Sprites/Items/Clock.png" id="1_ybxan"]
  4. [ext_resource type="Script" uid="uid://caq1qiwmy0mox" path="res://Scripts/Parts/BetterAnimatedSprite.gd" id="2_heiyr"]
  5. [ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="3_ov4xw"]
  6. [ext_resource type="JSON" path="res://Assets/Sprites/Items/Clock.json" id="4_newwu"]
  7. [ext_resource type="Script" uid="uid://cnheej0sxmoxg" path="res://Scripts/Parts/PlayerDetection.gd" id="5_fg0gx"]
  8. [ext_resource type="Script" uid="uid://dt2p68xl462v2" path="res://Scripts/Parts/TextShadowColourChanger.gd" id="6_ggci8"]
  9. [ext_resource type="Script" uid="uid://co6tjg3w6qpd8" path="res://Scripts/Parts/LabelFontChanger.gd" id="7_eol0e"]
  10. [ext_resource type="Resource" uid="uid://8dcuxbc3h2u2" path="res://Resources/ThemedResources/Font.tres" id="8_34q7a"]
  11. [sub_resource type="AtlasTexture" id="AtlasTexture_c30tx"]
  12. atlas = ExtResource("1_ybxan")
  13. region = Rect2(0, 0, 16, 16)
  14. [sub_resource type="SpriteFrames" id="SpriteFrames_qa2fo"]
  15. animations = [{
  16. "frames": [{
  17. "duration": 1.0,
  18. "texture": SubResource("AtlasTexture_c30tx")
  19. }],
  20. "loop": true,
  21. "name": &"default",
  22. "speed": 5.0
  23. }]
  24. [sub_resource type="RectangleShape2D" id="RectangleShape2D_ydslq"]
  25. size = Vector2(12, 12)
  26. [sub_resource type="Animation" id="Animation_heiyr"]
  27. resource_name = "Appear"
  28. tracks/0/type = "value"
  29. tracks/0/imported = false
  30. tracks/0/enabled = true
  31. tracks/0/path = NodePath(".:visible")
  32. tracks/0/interp = 1
  33. tracks/0/loop_wrap = true
  34. tracks/0/keys = {
  35. "times": PackedFloat32Array(0),
  36. "transitions": PackedFloat32Array(1),
  37. "update": 1,
  38. "values": [true]
  39. }
  40. tracks/1/type = "value"
  41. tracks/1/imported = false
  42. tracks/1/enabled = true
  43. tracks/1/path = NodePath(".:position")
  44. tracks/1/interp = 1
  45. tracks/1/loop_wrap = true
  46. tracks/1/keys = {
  47. "times": PackedFloat32Array(0, 0.5),
  48. "transitions": PackedFloat32Array(1, 1),
  49. "update": 0,
  50. "values": [Vector2(-24, -8), Vector2(-24, -16)]
  51. }
  52. tracks/2/type = "method"
  53. tracks/2/imported = false
  54. tracks/2/enabled = true
  55. tracks/2/path = NodePath("..")
  56. tracks/2/interp = 1
  57. tracks/2/loop_wrap = true
  58. tracks/2/keys = {
  59. "times": PackedFloat32Array(1),
  60. "transitions": PackedFloat32Array(1),
  61. "values": [{
  62. "args": [],
  63. "method": &"queue_free"
  64. }]
  65. }
  66. tracks/3/type = "method"
  67. tracks/3/imported = false
  68. tracks/3/enabled = true
  69. tracks/3/path = NodePath("../Sprite")
  70. tracks/3/interp = 1
  71. tracks/3/loop_wrap = true
  72. tracks/3/keys = {
  73. "times": PackedFloat32Array(0),
  74. "transitions": PackedFloat32Array(1),
  75. "values": [{
  76. "args": [],
  77. "method": &"queue_free"
  78. }]
  79. }
  80. [sub_resource type="Animation" id="Animation_ybxan"]
  81. length = 0.001
  82. tracks/0/type = "value"
  83. tracks/0/imported = false
  84. tracks/0/enabled = true
  85. tracks/0/path = NodePath(".:visible")
  86. tracks/0/interp = 1
  87. tracks/0/loop_wrap = true
  88. tracks/0/keys = {
  89. "times": PackedFloat32Array(0),
  90. "transitions": PackedFloat32Array(1),
  91. "update": 1,
  92. "values": [false]
  93. }
  94. tracks/1/type = "value"
  95. tracks/1/imported = false
  96. tracks/1/enabled = true
  97. tracks/1/path = NodePath(".:position")
  98. tracks/1/interp = 1
  99. tracks/1/loop_wrap = true
  100. tracks/1/keys = {
  101. "times": PackedFloat32Array(0),
  102. "transitions": PackedFloat32Array(1),
  103. "update": 0,
  104. "values": [Vector2(-24, -8)]
  105. }
  106. [sub_resource type="AnimationLibrary" id="AnimationLibrary_ov4xw"]
  107. _data = {
  108. &"Appear": SubResource("Animation_heiyr"),
  109. &"RESET": SubResource("Animation_ybxan")
  110. }
  111. [node name="ClockItem" type="CharacterBody2D"]
  112. script = ExtResource("1_heiyr")
  113. metadata/_custom_type_script = "uid://cjkurwybsaywm"
  114. [node name="Sprite" type="AnimatedSprite2D" parent="."]
  115. position = Vector2(0, -8)
  116. sprite_frames = SubResource("SpriteFrames_qa2fo")
  117. offset = Vector2(0, 1)
  118. script = ExtResource("2_heiyr")
  119. do_offset = false
  120. metadata/_custom_type_script = "uid://caq1qiwmy0mox"
  121. [node name="ResourceSetterNew" type="Node" parent="Sprite" node_paths=PackedStringArray("node_to_affect")]
  122. script = ExtResource("3_ov4xw")
  123. node_to_affect = NodePath("..")
  124. property_name = "sprite_frames"
  125. resource_json = ExtResource("4_newwu")
  126. metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
  127. [node name="Hitbox" type="Area2D" parent="Sprite"]
  128. script = ExtResource("5_fg0gx")
  129. metadata/_custom_type_script = "uid://cnheej0sxmoxg"
  130. [node name="CollisionShape2D" type="CollisionShape2D" parent="Sprite/Hitbox"]
  131. shape = SubResource("RectangleShape2D_ydslq")
  132. [node name="Label" type="Label" parent="."]
  133. visible = false
  134. offset_left = -24.0
  135. offset_top = -8.0
  136. offset_right = 24.0
  137. offset_bottom = 8.0
  138. text = "+100"
  139. horizontal_alignment = 1
  140. uppercase = true
  141. [node name="TextShadowColourChanger" type="Node" parent="Label" node_paths=PackedStringArray("labels")]
  142. script = ExtResource("6_ggci8")
  143. labels = [NodePath("..")]
  144. metadata/_custom_type_script = "uid://dt2p68xl462v2"
  145. [node name="LabelFontChanger" type="Node" parent="Label" node_paths=PackedStringArray("labels")]
  146. script = ExtResource("7_eol0e")
  147. labels = [NodePath("..")]
  148. resource = ExtResource("8_34q7a")
  149. metadata/_custom_type_script = "uid://co6tjg3w6qpd8"
  150. [node name="AnimationPlayer" type="AnimationPlayer" parent="Label"]
  151. libraries = {
  152. &"": SubResource("AnimationLibrary_ov4xw")
  153. }
  154. [connection signal="player_entered" from="Sprite/Hitbox" to="." method="collect_item"]