FighterFly.tscn 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. [gd_scene load_steps=28 format=3 uid="uid://cwhvsfp31cuu6"]
  2. [ext_resource type="Script" uid="uid://cemetiu57dblq" path="res://Scripts/Classes/Entities/Enemies/FighterFly.gd" id="1_unlki"]
  3. [ext_resource type="Texture2D" uid="uid://gnac5qwog2ar" path="res://Assets/Sprites/Enemies/FighterFly.png" id="2_jslnt"]
  4. [ext_resource type="Script" uid="uid://caq1qiwmy0mox" path="res://Scripts/Parts/BetterAnimatedSprite.gd" id="3_j4row"]
  5. [ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="4_unlki"]
  6. [ext_resource type="JSON" path="res://Assets/Sprites/Enemies/FighterFly.json" id="5_d7ynx"]
  7. [ext_resource type="Script" uid="uid://chj8hu207lrh" path="res://Scripts/Classes/Components/EnemyPlayerDetection.gd" id="5_s0as8"]
  8. [ext_resource type="Script" uid="uid://c3gg32ivrlq8n" path="res://Scripts/Classes/Components/GibSpawner.gd" id="6_d7ynx"]
  9. [ext_resource type="Script" uid="uid://cmg61722ktg2m" path="res://Scripts/Classes/Components/BlockBouncingDetection.gd" id="7_nm5h2"]
  10. [ext_resource type="Script" uid="uid://dri2d5jtu0fbq" path="res://Scripts/Classes/Components/FireballDetection.gd" id="8_s7wf1"]
  11. [ext_resource type="Script" uid="uid://bbww34oiexbx2" path="res://Scripts/Classes/Components/ShellDetection.gd" id="9_wbo1r"]
  12. [ext_resource type="Script" uid="uid://5octqlf4ohel" path="res://Scripts/Classes/Components/ScoreNoteSpawner.gd" id="10_0bgxg"]
  13. [ext_resource type="Script" uid="uid://dq860i312isk" path="res://Scripts/Classes/Components/IcicleDetection.gd" id="11_aeemo"]
  14. [ext_resource type="Script" uid="uid://dlq6o2rg1x7in" path="res://Scripts/Classes/Components/BasicEnemyMovement.gd" id="12_g551b"]
  15. [ext_resource type="Script" uid="uid://cqif1li7otvpl" path="res://Scripts/Parts/SpriteFramesToJsonConverter.gd" id="14_unlki"]
  16. [ext_resource type="Script" uid="uid://cmvlgsjmsk0v5" path="res://Scripts/Classes/Resources/ThemedResource.gd" id="15_s0as8"]
  17. [ext_resource type="Script" uid="uid://ba18grqjixded" path="res://Scripts/Classes/Components/ExplosionDetection.gd" id="16_s0as8"]
  18. [sub_resource type="AtlasTexture" id="AtlasTexture_nm5h2"]
  19. atlas = ExtResource("2_jslnt")
  20. region = Rect2(0, 0, 16, 16)
  21. [sub_resource type="AtlasTexture" id="AtlasTexture_s7wf1"]
  22. atlas = ExtResource("2_jslnt")
  23. region = Rect2(16, 0, 16, 16)
  24. [sub_resource type="AtlasTexture" id="AtlasTexture_d7ynx"]
  25. atlas = ExtResource("2_jslnt")
  26. region = Rect2(32, 0, 16, 16)
  27. [sub_resource type="SpriteFrames" id="SpriteFrames_wbo1r"]
  28. animations = [{
  29. "frames": [{
  30. "duration": 1.0,
  31. "texture": SubResource("AtlasTexture_nm5h2")
  32. }, {
  33. "duration": 1.0,
  34. "texture": SubResource("AtlasTexture_s7wf1")
  35. }],
  36. "loop": true,
  37. "name": &"Fly",
  38. "speed": 15.0
  39. }, {
  40. "frames": [{
  41. "duration": 1.0,
  42. "texture": SubResource("AtlasTexture_d7ynx")
  43. }],
  44. "loop": true,
  45. "name": &"Idle",
  46. "speed": 5.0
  47. }]
  48. [sub_resource type="RectangleShape2D" id="RectangleShape2D_e62ic"]
  49. size = Vector2(12, 12)
  50. [sub_resource type="RectangleShape2D" id="RectangleShape2D_qm5my"]
  51. size = Vector2(14, 14)
  52. [sub_resource type="AtlasTexture" id="AtlasTexture_wbo1r"]
  53. atlas = ExtResource("2_jslnt")
  54. region = Rect2(0, 16, 16, 16)
  55. [sub_resource type="AtlasTexture" id="AtlasTexture_0bgxg"]
  56. atlas = ExtResource("2_jslnt")
  57. region = Rect2(16, 16, 16, 16)
  58. [sub_resource type="AtlasTexture" id="AtlasTexture_aeemo"]
  59. atlas = ExtResource("2_jslnt")
  60. region = Rect2(32, 16, 16, 16)
  61. [sub_resource type="SpriteFrames" id="SpriteFrames_g551b"]
  62. animations = [{
  63. "frames": [{
  64. "duration": 1.0,
  65. "texture": SubResource("AtlasTexture_wbo1r")
  66. }, {
  67. "duration": 1.0,
  68. "texture": SubResource("AtlasTexture_0bgxg")
  69. }],
  70. "loop": true,
  71. "name": &"Fly",
  72. "speed": 15.0
  73. }, {
  74. "frames": [{
  75. "duration": 1.0,
  76. "texture": SubResource("AtlasTexture_aeemo")
  77. }],
  78. "loop": true,
  79. "name": &"Idle",
  80. "speed": 5.0
  81. }]
  82. [sub_resource type="Resource" id="Resource_g1y3b"]
  83. script = ExtResource("15_s0as8")
  84. Overworld = SubResource("SpriteFrames_wbo1r")
  85. Underground = SubResource("SpriteFrames_g551b")
  86. metadata/_custom_type_script = "uid://cmvlgsjmsk0v5"
  87. [node name="FighterFly" type="CharacterBody2D" node_paths=PackedStringArray("on_screen_enabler", "score_note_adder") groups=["Enemies"]]
  88. collision_layer = 16
  89. collision_mask = 50
  90. script = ExtResource("1_unlki")
  91. on_screen_enabler = NodePath("VisibleOnScreenEnabler2D")
  92. score_note_adder = NodePath("ScoreNoteSpawner")
  93. [node name="Sprite" type="AnimatedSprite2D" parent="."]
  94. position = Vector2(0, -8)
  95. sprite_frames = SubResource("SpriteFrames_wbo1r")
  96. animation = &"Idle"
  97. autoplay = "Fly"
  98. frame_progress = 0.526965
  99. script = ExtResource("3_j4row")
  100. metadata/_custom_type_script = "uid://caq1qiwmy0mox"
  101. [node name="ResourceSetterNew" type="Node" parent="Sprite" node_paths=PackedStringArray("node_to_affect")]
  102. script = ExtResource("4_unlki")
  103. node_to_affect = NodePath("..")
  104. property_name = "sprite_frames"
  105. resource_json = ExtResource("5_d7ynx")
  106. metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
  107. [node name="Collision" type="CollisionShape2D" parent="."]
  108. position = Vector2(0, -6)
  109. rotation = 1.5707964
  110. shape = SubResource("RectangleShape2D_e62ic")
  111. one_way_collision = true
  112. [node name="Collision2" type="CollisionShape2D" parent="."]
  113. position = Vector2(0, -6)
  114. rotation = -1.5707964
  115. shape = SubResource("RectangleShape2D_e62ic")
  116. one_way_collision = true
  117. [node name="Hitbox" type="Area2D" parent="."]
  118. [node name="Shape" type="CollisionShape2D" parent="Hitbox"]
  119. visible = false
  120. position = Vector2(0, -7)
  121. shape = SubResource("RectangleShape2D_qm5my")
  122. [node name="EnemyPlayerDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  123. script = ExtResource("5_s0as8")
  124. hitbox = NodePath("../Hitbox")
  125. [node name="VisibleOnScreenEnabler2D" type="VisibleOnScreenEnabler2D" parent="."]
  126. self_modulate = Color(1, 1, 1, 0)
  127. position = Vector2(0, -8)
  128. [node name="GibSpawner" type="Node" parent="." node_paths=PackedStringArray("visuals")]
  129. script = ExtResource("6_d7ynx")
  130. visuals = NodePath("../Sprite")
  131. [node name="BlockBouncingDetection" type="Node" parent="."]
  132. script = ExtResource("7_nm5h2")
  133. [node name="FireballDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  134. script = ExtResource("8_s7wf1")
  135. hitbox = NodePath("../Hitbox")
  136. [node name="ShellDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  137. script = ExtResource("9_wbo1r")
  138. hitbox = NodePath("../Hitbox")
  139. metadata/_custom_type_script = "uid://bbww34oiexbx2"
  140. [node name="ScoreNoteSpawner" type="Node" parent="."]
  141. script = ExtResource("10_0bgxg")
  142. add_score = true
  143. [node name="Node" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  144. script = ExtResource("11_aeemo")
  145. hitbox = NodePath("../Hitbox")
  146. [node name="BasicEnemyMovement" type="Node" parent="." node_paths=PackedStringArray("visuals")]
  147. script = ExtResource("12_g551b")
  148. move_speed = 30
  149. bounce_on_land = true
  150. bounce_height = -150
  151. visuals = NodePath("../Sprite")
  152. metadata/_custom_type_script = "uid://dlq6o2rg1x7in"
  153. [node name="ThemedToJSONConverter" type="Node" parent="."]
  154. script = ExtResource("14_unlki")
  155. resource = SubResource("Resource_g1y3b")
  156. json_file_path = "res://Assets/Sprites/Enemies/FighterFly.json"
  157. metadata/_custom_type_script = "uid://cqif1li7otvpl"
  158. [node name="ExplosionDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  159. script = ExtResource("16_s0as8")
  160. hitbox = NodePath("../Hitbox")
  161. metadata/_custom_type_script = "uid://ba18grqjixded"
  162. [connection signal="killed" from="." to="GibSpawner" method="summon_gib"]
  163. [connection signal="invincible_player_hit" from="EnemyPlayerDetection" to="." method="die_from_object"]
  164. [connection signal="invincible_player_hit" from="EnemyPlayerDetection" to="ScoreNoteSpawner" method="spawn_note" binds= [100]]
  165. [connection signal="player_hit" from="EnemyPlayerDetection" to="." method="damage_player"]
  166. [connection signal="player_stomped_on" from="EnemyPlayerDetection" to="." method="damage_player"]
  167. [connection signal="block_bounced" from="BlockBouncingDetection" to="." method="die_from_object"]
  168. [connection signal="block_bounced" from="BlockBouncingDetection" to="ScoreNoteSpawner" method="spawn_note" binds= [100]]
  169. [connection signal="fireball_hit" from="FireballDetection" to="." method="die_from_object"]
  170. [connection signal="fireball_hit" from="FireballDetection" to="ScoreNoteSpawner" method="spawn_note" binds= [100]]
  171. [connection signal="moving_shell_entered" from="ShellDetection" to="." method="die_from_object"]
  172. [connection signal="icicle_detected" from="Node" to="." method="die_from_object"]
  173. [connection signal="explosion_entered" from="ExplosionDetection" to="." method="die_from_object"]
  174. [connection signal="explosion_entered" from="ExplosionDetection" to="ScoreNoteSpawner" method="spawn_note" binds= [100]]