GreenKoopaTroopa.tscn 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. [gd_scene load_steps=25 format=3 uid="uid://r6dlmokkdyar"]
  2. [ext_resource type="Script" uid="uid://q8gx0l64pcjh" path="res://Scripts/Classes/Entities/Enemies/KoopaTroopa.gd" id="1_ykjo1"]
  3. [ext_resource type="Texture2D" uid="uid://cy6v7tdtxebs5" path="res://Assets/Sprites/Enemies/KoopaTroopa.png" id="2_ykjo1"]
  4. [ext_resource type="Script" uid="uid://caq1qiwmy0mox" path="res://Scripts/Parts/BetterAnimatedSprite.gd" id="3_2rsfy"]
  5. [ext_resource type="Script" uid="uid://chj8hu207lrh" path="res://Scripts/Classes/Components/EnemyPlayerDetection.gd" id="4_1sj6f"]
  6. [ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="4_71l08"]
  7. [ext_resource type="Script" uid="uid://dri2d5jtu0fbq" path="res://Scripts/Classes/Components/FireballDetection.gd" id="5_8y4pd"]
  8. [ext_resource type="JSON" path="res://Assets/Sprites/Enemies/GreenKoopaTroopa.json" id="5_mook0"]
  9. [ext_resource type="JSON" path="res://Assets/Sprites/Enemies/GreenKoopaShell.json" id="6_71l08"]
  10. [ext_resource type="Script" uid="uid://c3gg32ivrlq8n" path="res://Scripts/Classes/Components/GibSpawner.gd" id="6_fop3r"]
  11. [ext_resource type="PackedScene" uid="uid://bupy7th8ln45c" path="res://Scenes/Parts/Wing.tscn" id="6_gkyfa"]
  12. [ext_resource type="Script" uid="uid://cmg61722ktg2m" path="res://Scripts/Classes/Components/BlockBouncingDetection.gd" id="7_fop3r"]
  13. [ext_resource type="Script" uid="uid://blfnd65xcx78c" path="res://Scripts/Classes/Components/LedgeDetectionCast.gd" id="8_gkyfa"]
  14. [ext_resource type="Script" uid="uid://bbww34oiexbx2" path="res://Scripts/Classes/Components/ShellDetection.gd" id="8_y8bq4"]
  15. [ext_resource type="Script" uid="uid://5octqlf4ohel" path="res://Scripts/Classes/Components/ScoreNoteSpawner.gd" id="9_gf50m"]
  16. [ext_resource type="Script" uid="uid://dq860i312isk" path="res://Scripts/Classes/Components/IcicleDetection.gd" id="12_iydhw"]
  17. [ext_resource type="Script" uid="uid://dlq6o2rg1x7in" path="res://Scripts/Classes/Components/BasicEnemyMovement.gd" id="15_71l08"]
  18. [ext_resource type="Script" uid="uid://ba18grqjixded" path="res://Scripts/Classes/Components/ExplosionDetection.gd" id="16_dgip2"]
  19. [ext_resource type="Script" uid="uid://d4a7yp6e55u8t" path="res://Scripts/Classes/Components/TrackJoint.gd" id="18_rldwo"]
  20. [ext_resource type="Script" uid="uid://maqpreddu5kg" path="res://Scripts/Classes/Components/LevelPersistance.gd" id="19_j14in"]
  21. [sub_resource type="AtlasTexture" id="AtlasTexture_71l08"]
  22. atlas = ExtResource("2_ykjo1")
  23. region = Rect2(0, 0, 16, 32)
  24. [sub_resource type="AtlasTexture" id="AtlasTexture_dgip2"]
  25. atlas = ExtResource("2_ykjo1")
  26. region = Rect2(16, 0, 16, 32)
  27. [sub_resource type="SpriteFrames" id="SpriteFrames_anxyg"]
  28. animations = [{
  29. "frames": [{
  30. "duration": 1.0,
  31. "texture": SubResource("AtlasTexture_71l08")
  32. }, {
  33. "duration": 1.0,
  34. "texture": SubResource("AtlasTexture_dgip2")
  35. }],
  36. "loop": true,
  37. "name": &"Walk",
  38. "speed": 5.0
  39. }]
  40. [sub_resource type="RectangleShape2D" id="RectangleShape2D_fop3r"]
  41. size = Vector2(12, 12)
  42. [sub_resource type="RectangleShape2D" id="RectangleShape2D_y8bq4"]
  43. size = Vector2(12, 13)
  44. [node name="GreenKoopaTroopa" type="CharacterBody2D" node_paths=PackedStringArray("on_screen_enabler", "score_note_adder") groups=["Enemies"]]
  45. disable_mode = 1
  46. collision_layer = 16
  47. collision_mask = 50
  48. script = ExtResource("1_ykjo1")
  49. shell_scene = "uid://bowadxqfmg636"
  50. on_screen_enabler = NodePath("VisibleOnScreenEnabler2D")
  51. score_note_adder = NodePath("ScoreNoteSpawner")
  52. metadata/_custom_type_script = "uid://bpydbpyjk1mt4"
  53. [node name="Sprite" type="AnimatedSprite2D" parent="."]
  54. position = Vector2(0, -16)
  55. scale = Vector2(-1, 1)
  56. sprite_frames = SubResource("SpriteFrames_anxyg")
  57. animation = &"Walk"
  58. autoplay = "Walk"
  59. offset = Vector2(0, 1)
  60. flip_h = true
  61. script = ExtResource("3_2rsfy")
  62. metadata/_custom_type_script = "uid://caq1qiwmy0mox"
  63. [node name="ResourceSetterNew" type="Node" parent="Sprite" node_paths=PackedStringArray("node_to_affect")]
  64. script = ExtResource("4_71l08")
  65. node_to_affect = NodePath("..")
  66. property_name = "sprite_frames"
  67. resource_json = ExtResource("5_mook0")
  68. metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
  69. [node name="Wing" parent="Sprite" instance=ExtResource("6_gkyfa")]
  70. unique_name_in_owner = true
  71. visible = false
  72. position = Vector2(-8, 3)
  73. autoplay = "Flap"
  74. frame_progress = 0.0
  75. flip_h = true
  76. [node name="DeathSprite" type="AnimatedSprite2D" parent="."]
  77. visible = false
  78. position = Vector2(0, -8)
  79. script = ExtResource("3_2rsfy")
  80. metadata/_custom_type_script = "uid://caq1qiwmy0mox"
  81. [node name="ResourceSetterNew" type="Node" parent="DeathSprite" node_paths=PackedStringArray("node_to_affect")]
  82. script = ExtResource("4_71l08")
  83. node_to_affect = NodePath("..")
  84. property_name = "sprite_frames"
  85. resource_json = ExtResource("6_71l08")
  86. metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
  87. [node name="Collision" type="CollisionShape2D" parent="."]
  88. visible = false
  89. position = Vector2(0, -6)
  90. rotation = 1.5708
  91. shape = SubResource("RectangleShape2D_fop3r")
  92. one_way_collision = true
  93. [node name="Collision2" type="CollisionShape2D" parent="."]
  94. visible = false
  95. position = Vector2(0, -6)
  96. rotation = -1.5708
  97. shape = SubResource("RectangleShape2D_fop3r")
  98. one_way_collision = true
  99. [node name="Hitbox" type="Area2D" parent="."]
  100. collision_mask = 7
  101. [node name="Shape" type="CollisionShape2D" parent="Hitbox"]
  102. position = Vector2(0, -5.5)
  103. shape = SubResource("RectangleShape2D_y8bq4")
  104. [node name="LedgeDetectionCast" type="RayCast2D" parent="."]
  105. position = Vector2(-8, -2)
  106. target_position = Vector2(0, 3)
  107. collision_mask = 2
  108. script = ExtResource("8_gkyfa")
  109. metadata/_custom_type_script = "uid://blfnd65xcx78c"
  110. [node name="VisibleOnScreenEnabler2D" type="VisibleOnScreenEnabler2D" parent="."]
  111. self_modulate = Color(1, 1, 1, 0)
  112. position = Vector2(0, -11)
  113. scale = Vector2(1, 1.3)
  114. [node name="EnemyPlayerDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  115. script = ExtResource("4_1sj6f")
  116. hitbox = NodePath("../Hitbox")
  117. metadata/_custom_type_script = "uid://chj8hu207lrh"
  118. [node name="FireballDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  119. script = ExtResource("5_8y4pd")
  120. hitbox = NodePath("../Hitbox")
  121. metadata/_custom_type_script = "uid://dri2d5jtu0fbq"
  122. [node name="GibSpawner" type="Node" parent="." node_paths=PackedStringArray("visuals")]
  123. script = ExtResource("6_fop3r")
  124. visuals = NodePath("../DeathSprite")
  125. metadata/_custom_type_script = "uid://c3gg32ivrlq8n"
  126. [node name="BlockBouncingDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  127. script = ExtResource("7_fop3r")
  128. detection_type = 1
  129. hitbox = NodePath("../Hitbox")
  130. metadata/_custom_type_script = "uid://cmg61722ktg2m"
  131. [node name="ShellDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  132. script = ExtResource("8_y8bq4")
  133. hitbox = NodePath("../Hitbox")
  134. [node name="ScoreNoteSpawner" type="Node" parent="."]
  135. script = ExtResource("9_gf50m")
  136. add_score = true
  137. metadata/_custom_type_script = "uid://5octqlf4ohel"
  138. [node name="IcicleDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  139. script = ExtResource("12_iydhw")
  140. hitbox = NodePath("../Hitbox")
  141. metadata/_custom_type_script = "uid://dq860i312isk"
  142. [node name="BasicEnemyMovement" type="Node" parent="."]
  143. script = ExtResource("15_71l08")
  144. auto_call = false
  145. [node name="ExplosionDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  146. script = ExtResource("16_dgip2")
  147. hitbox = NodePath("../Hitbox")
  148. [node name="TrackJoint" type="Node" parent="." node_paths=PackedStringArray("movement_node")]
  149. script = ExtResource("18_rldwo")
  150. movement_node = NodePath("../BasicEnemyMovement")
  151. metadata/_custom_type_script = "uid://d4a7yp6e55u8t"
  152. [node name="LevelPersistance" type="Node" parent="."]
  153. script = ExtResource("19_j14in")
  154. metadata/_custom_type_script = "uid://maqpreddu5kg"
  155. [connection signal="killed" from="." to="GibSpawner" method="summon_gib"]
  156. [connection signal="killed" from="." to="LevelPersistance" method="set_as_active" unbinds=1]
  157. [connection signal="invincible_player_hit" from="EnemyPlayerDetection" to="." method="die_from_object"]
  158. [connection signal="invincible_player_hit" from="EnemyPlayerDetection" to="ScoreNoteSpawner" method="spawn_note" binds= [200]]
  159. [connection signal="player_hit" from="EnemyPlayerDetection" to="." method="damage_player"]
  160. [connection signal="player_stomped_on" from="EnemyPlayerDetection" to="." method="stomped_on"]
  161. [connection signal="player_stomped_on" from="EnemyPlayerDetection" to="LevelPersistance" method="set_as_active" unbinds=1]
  162. [connection signal="fireball_hit" from="FireballDetection" to="." method="die_from_object"]
  163. [connection signal="fireball_hit" from="FireballDetection" to="ScoreNoteSpawner" method="spawn_note" binds= [200]]
  164. [connection signal="block_bounced" from="BlockBouncingDetection" to="ScoreNoteSpawner" method="spawn_note" binds= [200]]
  165. [connection signal="block_bounced" from="BlockBouncingDetection" to="." method="block_bounced" unbinds=1]
  166. [connection signal="moving_shell_entered" from="ShellDetection" to="." method="die_from_object"]
  167. [connection signal="icicle_detected" from="IcicleDetection" to="." method="die_from_object"]
  168. [connection signal="explosion_entered" from="ExplosionDetection" to="." method="die_from_object"]
  169. [connection signal="explosion_entered" from="ExplosionDetection" to="ScoreNoteSpawner" method="spawn_note" binds= [200]]
  170. [connection signal="enabled" from="LevelPersistance" to="." method="queue_free"]