SuperMushroom.tscn 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. [gd_scene load_steps=13 format=3 uid="uid://beq7b3hp44onn"]
  2. [ext_resource type="Script" uid="uid://dlrdjo1ksvp7q" path="res://Scripts/Classes/Entities/Items/SuperMushroom.gd" id="1_j8f56"]
  3. [ext_resource type="Texture2D" uid="uid://hfh5i32uji5t" path="res://Assets/Sprites/Items/SuperMushroom.png" id="2_kycr3"]
  4. [ext_resource type="Script" uid="uid://caq1qiwmy0mox" path="res://Scripts/Parts/BetterAnimatedSprite.gd" id="3_20ogn"]
  5. [ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="3_i28px"]
  6. [ext_resource type="Script" uid="uid://cmg61722ktg2m" path="res://Scripts/Classes/Components/BlockBouncingDetection.gd" id="3_kycr3"]
  7. [ext_resource type="JSON" path="res://Assets/Sprites/Items/SuperMushroom.json" id="4_waj2c"]
  8. [ext_resource type="Script" uid="uid://dlq6o2rg1x7in" path="res://Scripts/Classes/Components/BasicEnemyMovement.gd" id="6_waj2c"]
  9. [ext_resource type="Script" uid="uid://d4a7yp6e55u8t" path="res://Scripts/Classes/Components/TrackJoint.gd" id="7_xop20"]
  10. [sub_resource type="AtlasTexture" id="AtlasTexture_xop20"]
  11. atlas = ExtResource("2_kycr3")
  12. region = Rect2(0, 0, 16, 16)
  13. [sub_resource type="SpriteFrames" id="SpriteFrames_20ogn"]
  14. animations = [{
  15. "frames": [{
  16. "duration": 1.0,
  17. "texture": SubResource("AtlasTexture_xop20")
  18. }],
  19. "loop": true,
  20. "name": &"default",
  21. "speed": 5.0
  22. }]
  23. [sub_resource type="RectangleShape2D" id="RectangleShape2D_eg5wg"]
  24. size = Vector2(10, 10)
  25. [sub_resource type="RectangleShape2D" id="RectangleShape2D_i28px"]
  26. size = Vector2(4, 8)
  27. [node name="SuperMushroom" type="CharacterBody2D"]
  28. collision_layer = 8
  29. collision_mask = 2
  30. script = ExtResource("1_j8f56")
  31. [node name="Mushroom" type="AnimatedSprite2D" parent="."]
  32. position = Vector2(0, -8)
  33. sprite_frames = SubResource("SpriteFrames_20ogn")
  34. offset = Vector2(0, 1)
  35. script = ExtResource("3_20ogn")
  36. metadata/_custom_type_script = "uid://caq1qiwmy0mox"
  37. [node name="ResourceSetterNew" type="Node" parent="Mushroom" node_paths=PackedStringArray("node_to_affect")]
  38. script = ExtResource("3_i28px")
  39. node_to_affect = NodePath("..")
  40. property_name = "sprite_frames"
  41. resource_json = ExtResource("4_waj2c")
  42. metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
  43. [node name="Hitbox" type="Area2D" parent="."]
  44. position = Vector2(0, -8)
  45. [node name="Shape" type="CollisionShape2D" parent="Hitbox"]
  46. shape = SubResource("RectangleShape2D_eg5wg")
  47. [node name="Collision" type="CollisionShape2D" parent="."]
  48. position = Vector2(0, -4)
  49. shape = SubResource("RectangleShape2D_i28px")
  50. [node name="BlockBouncingDetection" type="Node" parent="."]
  51. script = ExtResource("3_kycr3")
  52. can_change_direction = true
  53. metadata/_custom_type_script = "uid://cmg61722ktg2m"
  54. [node name="BasicEnemyMovement" type="Node" parent="."]
  55. script = ExtResource("6_waj2c")
  56. auto_call = false
  57. move_speed = 65
  58. [node name="TrackJoint" type="Node" parent="." node_paths=PackedStringArray("movement_node")]
  59. script = ExtResource("7_xop20")
  60. movement_node = NodePath("../BasicEnemyMovement")
  61. metadata/_custom_type_script = "uid://d4a7yp6e55u8t"
  62. [connection signal="area_entered" from="Hitbox" to="." method="on_area_entered"]
  63. [connection signal="block_bounced" from="BlockBouncingDetection" to="." method="block_bounce_up" unbinds=1]