Fireball.tscn 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. [gd_scene load_steps=9 format=3 uid="uid://dutrlpq47wguf"]
  2. [ext_resource type="Script" uid="uid://yh4pop7sm56c" path="res://Scripts/Classes/Entities/Items/Fireball.gd" id="1_00jom"]
  3. [ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="2_gfqet"]
  4. [ext_resource type="JSON" path="res://Assets/Sprites/Items/PlayerFireball.json" id="3_an01s"]
  5. [sub_resource type="Animation" id="Animation_gfqet"]
  6. length = 0.001
  7. tracks/0/type = "value"
  8. tracks/0/imported = false
  9. tracks/0/enabled = true
  10. tracks/0/path = NodePath(".:rotation")
  11. tracks/0/interp = 1
  12. tracks/0/loop_wrap = true
  13. tracks/0/keys = {
  14. "times": PackedFloat32Array(0),
  15. "transitions": PackedFloat32Array(1),
  16. "update": 0,
  17. "values": [0.0]
  18. }
  19. [sub_resource type="Animation" id="Animation_00jom"]
  20. resource_name = "Spin"
  21. length = 0.4
  22. loop_mode = 1
  23. step = 0.1
  24. tracks/0/type = "value"
  25. tracks/0/imported = false
  26. tracks/0/enabled = true
  27. tracks/0/path = NodePath(".:rotation")
  28. tracks/0/interp = 0
  29. tracks/0/loop_wrap = true
  30. tracks/0/keys = {
  31. "times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4),
  32. "transitions": PackedFloat32Array(1, 1, 1, 1, 1),
  33. "update": 0,
  34. "values": [0.0, 1.5708, 3.14159, 4.71239, 6.28319]
  35. }
  36. [sub_resource type="AnimationLibrary" id="AnimationLibrary_an01s"]
  37. _data = {
  38. &"RESET": SubResource("Animation_gfqet"),
  39. &"Spin": SubResource("Animation_00jom")
  40. }
  41. [sub_resource type="RectangleShape2D" id="RectangleShape2D_ajyso"]
  42. size = Vector2(6, 8)
  43. [sub_resource type="CircleShape2D" id="CircleShape2D_dhdpv"]
  44. radius = 8.0
  45. [node name="Fireball" type="CharacterBody2D"]
  46. collision_layer = 0
  47. collision_mask = 2
  48. slide_on_ceiling = false
  49. script = ExtResource("1_00jom")
  50. [node name="Sprite" type="AnimatedSprite2D" parent="."]
  51. z_index = 2
  52. [node name="Animation" type="AnimationPlayer" parent="Sprite"]
  53. libraries = {
  54. &"": SubResource("AnimationLibrary_an01s")
  55. }
  56. autoplay = "Spin"
  57. speed_scale = 2.0
  58. [node name="ResourceSetter" type="Node" parent="Sprite" node_paths=PackedStringArray("node_to_affect")]
  59. script = ExtResource("2_gfqet")
  60. node_to_affect = NodePath("..")
  61. property_name = "sprite_frames"
  62. resource_json = ExtResource("3_an01s")
  63. metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
  64. [node name="Collision" type="CollisionShape2D" parent="."]
  65. shape = SubResource("RectangleShape2D_ajyso")
  66. [node name="Hitbox" type="Area2D" parent="."]
  67. visible = false
  68. [node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"]
  69. shape = SubResource("CircleShape2D_dhdpv")
  70. [node name="VisibleOnScreenNotifier2D" type="VisibleOnScreenNotifier2D" parent="."]
  71. [connection signal="screen_exited" from="VisibleOnScreenNotifier2D" to="." method="queue_free"]