RedCoin.tscn 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. [gd_scene load_steps=18 format=3 uid="uid://cmbpqnq10arts"]
  2. [ext_resource type="Script" uid="uid://xwq5ac650e76" path="res://Scripts/Classes/Entities/Items/RedCoin.gd" id="1_c6tmk"]
  3. [ext_resource type="Texture2D" uid="uid://c8wpxm7b5tgiq" path="res://Assets/Sprites/Items/RedCoin.png" id="2_lwdcj"]
  4. [ext_resource type="Script" uid="uid://caq1qiwmy0mox" path="res://Scripts/Parts/BetterAnimatedSprite.gd" id="3_0r8d3"]
  5. [ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="3_0xloa"]
  6. [ext_resource type="Script" uid="uid://cnheej0sxmoxg" path="res://Scripts/Parts/PlayerDetection.gd" id="3_onh0k"]
  7. [ext_resource type="Script" uid="uid://cmg61722ktg2m" path="res://Scripts/Classes/Components/BlockBouncingDetection.gd" id="4_lwdcj"]
  8. [ext_resource type="JSON" path="res://Assets/Sprites/Items/RedCoin.json" id="5_0fjrw"]
  9. [sub_resource type="AtlasTexture" id="AtlasTexture_lwdcj"]
  10. atlas = ExtResource("2_lwdcj")
  11. region = Rect2(0, 16, 16, 16)
  12. [sub_resource type="AtlasTexture" id="AtlasTexture_onh0k"]
  13. atlas = ExtResource("2_lwdcj")
  14. region = Rect2(16, 16, 16, 16)
  15. [sub_resource type="AtlasTexture" id="AtlasTexture_1w0wa"]
  16. atlas = ExtResource("2_lwdcj")
  17. region = Rect2(32, 16, 16, 16)
  18. [sub_resource type="AtlasTexture" id="AtlasTexture_4qu2r"]
  19. atlas = ExtResource("2_lwdcj")
  20. region = Rect2(48, 16, 16, 16)
  21. [sub_resource type="AtlasTexture" id="AtlasTexture_0xloa"]
  22. atlas = ExtResource("2_lwdcj")
  23. region = Rect2(0, 0, 16, 16)
  24. [sub_resource type="AtlasTexture" id="AtlasTexture_0r8d3"]
  25. atlas = ExtResource("2_lwdcj")
  26. region = Rect2(16, 0, 16, 16)
  27. [sub_resource type="AtlasTexture" id="AtlasTexture_0fjrw"]
  28. atlas = ExtResource("2_lwdcj")
  29. region = Rect2(32, 0, 16, 16)
  30. [sub_resource type="AtlasTexture" id="AtlasTexture_ppl3b"]
  31. atlas = ExtResource("2_lwdcj")
  32. region = Rect2(48, 0, 16, 16)
  33. [sub_resource type="SpriteFrames" id="SpriteFrames_1w0wa"]
  34. animations = [{
  35. "frames": [{
  36. "duration": 1.0,
  37. "texture": SubResource("AtlasTexture_lwdcj")
  38. }, {
  39. "duration": 1.0,
  40. "texture": SubResource("AtlasTexture_onh0k")
  41. }, {
  42. "duration": 1.0,
  43. "texture": SubResource("AtlasTexture_1w0wa")
  44. }, {
  45. "duration": 1.0,
  46. "texture": SubResource("AtlasTexture_4qu2r")
  47. }],
  48. "loop": true,
  49. "name": &"Collected",
  50. "speed": 8.0
  51. }, {
  52. "frames": [{
  53. "duration": 1.0,
  54. "texture": SubResource("AtlasTexture_0xloa")
  55. }, {
  56. "duration": 1.0,
  57. "texture": SubResource("AtlasTexture_0r8d3")
  58. }, {
  59. "duration": 1.0,
  60. "texture": SubResource("AtlasTexture_0fjrw")
  61. }, {
  62. "duration": 1.0,
  63. "texture": SubResource("AtlasTexture_ppl3b")
  64. }],
  65. "loop": true,
  66. "name": &"Idle",
  67. "speed": 8.0
  68. }]
  69. [sub_resource type="RectangleShape2D" id="RectangleShape2D_4qu2r"]
  70. size = Vector2(12, 15)
  71. [node name="RedCoin" type="Node2D"]
  72. visibility_layer = 3
  73. z_index = -2
  74. script = ExtResource("1_c6tmk")
  75. [node name="Sprite" type="AnimatedSprite2D" parent="."]
  76. sprite_frames = SubResource("SpriteFrames_1w0wa")
  77. animation = &"Idle"
  78. autoplay = "Idle"
  79. script = ExtResource("3_0r8d3")
  80. do_offset = false
  81. metadata/_custom_type_script = "uid://caq1qiwmy0mox"
  82. [node name="ResourceSetterNew" type="Node" parent="Sprite" node_paths=PackedStringArray("node_to_affect")]
  83. script = ExtResource("3_0xloa")
  84. node_to_affect = NodePath("..")
  85. property_name = "sprite_frames"
  86. resource_json = ExtResource("5_0fjrw")
  87. metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
  88. [node name="Hitbox" type="Area2D" parent="."]
  89. collision_mask = 5
  90. script = ExtResource("3_onh0k")
  91. metadata/_custom_type_script = "uid://cnheej0sxmoxg"
  92. [node name="Shape" type="CollisionShape2D" parent="Hitbox"]
  93. position = Vector2(0, 1.5)
  94. shape = SubResource("RectangleShape2D_4qu2r")
  95. [node name="BlockBouncingDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  96. script = ExtResource("4_lwdcj")
  97. detection_type = 1
  98. hitbox = NodePath("../Hitbox")
  99. metadata/_custom_type_script = "uid://cmg61722ktg2m"
  100. [connection signal="player_entered" from="Hitbox" to="." method="on_player_entered"]
  101. [connection signal="block_bounced" from="BlockBouncingDetection" to="." method="summon_bounced_coin" unbinds=1]