Coin.tscn 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. [gd_scene load_steps=17 format=3 uid="uid://chjxyhlwohmi6"]
  2. [ext_resource type="Script" uid="uid://cexcll4frt0t6" path="res://Scripts/Classes/Entities/Items/Coin.gd" id="1_c6elg"]
  3. [ext_resource type="Texture2D" uid="uid://b6o28xa83npb1" path="res://Assets/Sprites/Items/StaticCoin.png" id="2_7vxr7"]
  4. [ext_resource type="PackedScene" uid="uid://clxssds8sj8pf" path="res://Scenes/Prefabs/Entities/Items/SpinningCoin.tscn" id="2_k3746"]
  5. [ext_resource type="Script" uid="uid://cmg61722ktg2m" path="res://Scripts/Classes/Components/BlockBouncingDetection.gd" id="3_korlu"]
  6. [ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="3_uahob"]
  7. [ext_resource type="JSON" path="res://Assets/Sprites/Items/Coin.json" id="4_thymr"]
  8. [ext_resource type="Script" uid="uid://bul1nbd2in1gn" path="res://Scripts/Classes/Components/PSwitcher.gd" id="6_uahob"]
  9. [ext_resource type="Script" uid="uid://d4a7yp6e55u8t" path="res://Scripts/Classes/Components/TrackJoint.gd" id="7_thymr"]
  10. [ext_resource type="Script" uid="uid://maqpreddu5kg" path="res://Scripts/Classes/Components/LevelPersistance.gd" id="8_apfal"]
  11. [sub_resource type="AtlasTexture" id="AtlasTexture_uahob"]
  12. atlas = ExtResource("2_7vxr7")
  13. region = Rect2(0, 0, 16, 16)
  14. [sub_resource type="AtlasTexture" id="AtlasTexture_thymr"]
  15. atlas = ExtResource("2_7vxr7")
  16. region = Rect2(16, 0, 16, 16)
  17. [sub_resource type="AtlasTexture" id="AtlasTexture_apfal"]
  18. atlas = ExtResource("2_7vxr7")
  19. region = Rect2(32, 0, 16, 16)
  20. [sub_resource type="AtlasTexture" id="AtlasTexture_k3746"]
  21. atlas = ExtResource("2_7vxr7")
  22. region = Rect2(48, 0, 16, 16)
  23. [sub_resource type="SpriteFrames" id="SpriteFrames_nu35s"]
  24. animations = [{
  25. "frames": [{
  26. "duration": 1.0,
  27. "texture": SubResource("AtlasTexture_uahob")
  28. }, {
  29. "duration": 1.0,
  30. "texture": SubResource("AtlasTexture_thymr")
  31. }, {
  32. "duration": 1.0,
  33. "texture": SubResource("AtlasTexture_apfal")
  34. }, {
  35. "duration": 1.0,
  36. "texture": SubResource("AtlasTexture_k3746")
  37. }],
  38. "loop": true,
  39. "name": &"default",
  40. "speed": 10.0
  41. }]
  42. [sub_resource type="RectangleShape2D" id="RectangleShape2D_edpyv"]
  43. size = Vector2(12, 12)
  44. [sub_resource type="RectangleShape2D" id="RectangleShape2D_qjj6w"]
  45. size = Vector2(8, 8)
  46. [node name="Coin" type="Node2D" groups=["Coins"]]
  47. z_index = -2
  48. script = ExtResource("1_c6elg")
  49. spinning_coin_scene = ExtResource("2_k3746")
  50. [node name="Sprite" type="AnimatedSprite2D" parent="."]
  51. sprite_frames = SubResource("SpriteFrames_nu35s")
  52. autoplay = "default"
  53. frame_progress = 0.487032
  54. [node name="ResourceSetterNew" type="Node" parent="Sprite" node_paths=PackedStringArray("node_to_affect")]
  55. script = ExtResource("3_uahob")
  56. node_to_affect = NodePath("..")
  57. property_name = "sprite_frames"
  58. resource_json = ExtResource("4_thymr")
  59. metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
  60. [node name="Hitbox" type="Area2D" parent="."]
  61. visible = false
  62. [node name="Shape" type="CollisionShape2D" parent="Hitbox"]
  63. shape = SubResource("RectangleShape2D_edpyv")
  64. [node name="BlockBouncingDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  65. script = ExtResource("3_korlu")
  66. detection_type = 1
  67. hitbox = NodePath("../BlockHitbox")
  68. metadata/_custom_type_script = "uid://cmg61722ktg2m"
  69. [node name="BlockHitbox" type="Area2D" parent="."]
  70. collision_layer = 0
  71. collision_mask = 6
  72. [node name="Shape" type="CollisionShape2D" parent="BlockHitbox"]
  73. position = Vector2(0, 12)
  74. shape = SubResource("RectangleShape2D_qjj6w")
  75. [node name="PSwitcher" type="Node" parent="."]
  76. script = ExtResource("6_uahob")
  77. new_scene = "uid://dsa8lpl7n8ge0"
  78. [node name="TrackJoint" type="Node" parent="."]
  79. script = ExtResource("7_thymr")
  80. offset = Vector2(0, 0)
  81. metadata/_custom_type_script = "uid://d4a7yp6e55u8t"
  82. [node name="LevelPersistance" type="Node" parent="."]
  83. script = ExtResource("8_apfal")
  84. [connection signal="collected" from="." to="LevelPersistance" method="set_as_active"]
  85. [connection signal="area_entered" from="Hitbox" to="." method="area_entered"]
  86. [connection signal="block_bounced" from="BlockBouncingDetection" to="." method="summon_block_coin" unbinds=1]
  87. [connection signal="enabled" from="LevelPersistance" to="." method="queue_free"]