Goomba.tscn 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. [gd_scene load_steps=24 format=3 uid="uid://dnx48rakxib6u"]
  2. [ext_resource type="Script" uid="uid://dv18do583a3x0" path="res://Scripts/Classes/Entities/Enemies/Goomba.gd" id="1_4f3if"]
  3. [ext_resource type="Texture2D" uid="uid://bvgp1xgj7cauc" path="res://Assets/Sprites/Enemies/Goomba.png" id="1_rvg4p"]
  4. [ext_resource type="Script" uid="uid://chj8hu207lrh" path="res://Scripts/Classes/Components/EnemyPlayerDetection.gd" id="2_4f3if"]
  5. [ext_resource type="Script" uid="uid://caq1qiwmy0mox" path="res://Scripts/Parts/BetterAnimatedSprite.gd" id="3_75r84"]
  6. [ext_resource type="Script" uid="uid://c3gg32ivrlq8n" path="res://Scripts/Classes/Components/GibSpawner.gd" id="4_7ob4c"]
  7. [ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="5_75r84"]
  8. [ext_resource type="Script" uid="uid://cmg61722ktg2m" path="res://Scripts/Classes/Components/BlockBouncingDetection.gd" id="5_ncruo"]
  9. [ext_resource type="JSON" path="res://Assets/Sprites/Enemies/Goomba.json" id="6_magh7"]
  10. [ext_resource type="Script" uid="uid://dri2d5jtu0fbq" path="res://Scripts/Classes/Components/FireballDetection.gd" id="6_yt1if"]
  11. [ext_resource type="Script" uid="uid://bbww34oiexbx2" path="res://Scripts/Classes/Components/ShellDetection.gd" id="7_d04bf"]
  12. [ext_resource type="Script" uid="uid://5octqlf4ohel" path="res://Scripts/Classes/Components/ScoreNoteSpawner.gd" id="8_e62ic"]
  13. [ext_resource type="Script" uid="uid://dq860i312isk" path="res://Scripts/Classes/Components/IcicleDetection.gd" id="11_067r1"]
  14. [ext_resource type="Script" uid="uid://blfnd65xcx78c" path="res://Scripts/Classes/Components/LedgeDetectionCast.gd" id="13_dpode"]
  15. [ext_resource type="Script" uid="uid://dlq6o2rg1x7in" path="res://Scripts/Classes/Components/BasicEnemyMovement.gd" id="13_magh7"]
  16. [ext_resource type="Script" uid="uid://ba18grqjixded" path="res://Scripts/Classes/Components/ExplosionDetection.gd" id="14_3aros"]
  17. [ext_resource type="Script" uid="uid://d0mqkvopasu8k" path="res://Scripts/Classes/Components/SecondQuestReplaceComponent.gd" id="15_dpode"]
  18. [ext_resource type="Script" uid="uid://d4a7yp6e55u8t" path="res://Scripts/Classes/Components/TrackJoint.gd" id="17_6o7qg"]
  19. [ext_resource type="Script" uid="uid://maqpreddu5kg" path="res://Scripts/Classes/Components/LevelPersistance.gd" id="18_hkf3f"]
  20. [sub_resource type="AtlasTexture" id="AtlasTexture_magh7"]
  21. atlas = ExtResource("1_rvg4p")
  22. region = Rect2(32, 0, 16, 16)
  23. [sub_resource type="AtlasTexture" id="AtlasTexture_hkf3f"]
  24. atlas = ExtResource("1_rvg4p")
  25. region = Rect2(0, 0, 16, 16)
  26. [sub_resource type="SpriteFrames" id="SpriteFrames_u44np"]
  27. animations = [{
  28. "frames": [{
  29. "duration": 1.0,
  30. "texture": SubResource("AtlasTexture_magh7")
  31. }],
  32. "loop": true,
  33. "name": &"Stomped",
  34. "speed": 5.0
  35. }, {
  36. "frames": [{
  37. "duration": 1.0,
  38. "texture": SubResource("AtlasTexture_hkf3f")
  39. }],
  40. "loop": true,
  41. "name": &"Walk",
  42. "speed": 5.0
  43. }]
  44. [sub_resource type="RectangleShape2D" id="RectangleShape2D_e62ic"]
  45. size = Vector2(12, 12)
  46. [sub_resource type="RectangleShape2D" id="RectangleShape2D_qm5my"]
  47. size = Vector2(14, 15)
  48. [node name="Goomba" type="CharacterBody2D" node_paths=PackedStringArray("on_screen_enabler", "score_note_adder") groups=["Enemies"]]
  49. collision_layer = 16
  50. collision_mask = 50
  51. floor_constant_speed = true
  52. floor_max_angle = 1.3613569
  53. script = ExtResource("1_4f3if")
  54. on_screen_enabler = NodePath("VisibleOnScreenEnabler2D")
  55. score_note_adder = NodePath("ScoreNoteSpawner")
  56. [node name="Sprite" type="AnimatedSprite2D" parent="."]
  57. position = Vector2(0, -8)
  58. scale = Vector2(-1, 1)
  59. sprite_frames = SubResource("SpriteFrames_u44np")
  60. animation = &"Walk"
  61. autoplay = "Walk"
  62. frame_progress = 0.274184
  63. offset = Vector2(0, 1)
  64. flip_h = true
  65. script = ExtResource("3_75r84")
  66. metadata/_custom_type_script = "uid://caq1qiwmy0mox"
  67. [node name="ResourceSetterNew" type="Node" parent="Sprite" node_paths=PackedStringArray("node_to_affect", "property_node")]
  68. script = ExtResource("5_75r84")
  69. node_to_affect = NodePath("..")
  70. property_node = NodePath("../..")
  71. property_name = "sprite_frames"
  72. resource_json = ExtResource("6_magh7")
  73. [node name="LCollision" type="CollisionShape2D" parent="."]
  74. position = Vector2(0, -6)
  75. rotation = 1.5708
  76. shape = SubResource("RectangleShape2D_e62ic")
  77. one_way_collision = true
  78. [node name="RCollision" type="CollisionShape2D" parent="."]
  79. position = Vector2(0, -6)
  80. rotation = -1.5708
  81. shape = SubResource("RectangleShape2D_e62ic")
  82. one_way_collision = true
  83. [node name="Hitbox" type="Area2D" parent="."]
  84. collision_mask = 7
  85. [node name="Shape" type="CollisionShape2D" parent="Hitbox"]
  86. position = Vector2(0, -6.5)
  87. shape = SubResource("RectangleShape2D_qm5my")
  88. [node name="EnemyPlayerDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  89. script = ExtResource("2_4f3if")
  90. hitbox = NodePath("../Hitbox")
  91. [node name="VisibleOnScreenEnabler2D" type="VisibleOnScreenEnabler2D" parent="."]
  92. self_modulate = Color(1, 1, 1, 0)
  93. position = Vector2(0, -8)
  94. [node name="GibSpawner" type="Node" parent="." node_paths=PackedStringArray("visuals")]
  95. script = ExtResource("4_7ob4c")
  96. visuals = NodePath("../Sprite")
  97. [node name="BlockBouncingDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  98. script = ExtResource("5_ncruo")
  99. detection_type = 1
  100. hitbox = NodePath("../Hitbox")
  101. [node name="FireballDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  102. script = ExtResource("6_yt1if")
  103. hitbox = NodePath("../Hitbox")
  104. [node name="ShellDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  105. script = ExtResource("7_d04bf")
  106. hitbox = NodePath("../Hitbox")
  107. metadata/_custom_type_script = "uid://bbww34oiexbx2"
  108. [node name="ScoreNoteSpawner" type="Node" parent="."]
  109. script = ExtResource("8_e62ic")
  110. add_score = true
  111. [node name="IcicleDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  112. script = ExtResource("11_067r1")
  113. hitbox = NodePath("../Hitbox")
  114. metadata/_custom_type_script = "uid://dq860i312isk"
  115. [node name="Node2D" type="Node2D" parent="."]
  116. [node name="LedgeDetectionCast" type="RayCast2D" parent="."]
  117. position = Vector2(-2, -2)
  118. target_position = Vector2(0, 3)
  119. collision_mask = 2
  120. script = ExtResource("13_dpode")
  121. [node name="BasicEnemyMovement" type="Node" parent="."]
  122. script = ExtResource("13_magh7")
  123. [node name="ExplosionDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  124. script = ExtResource("14_3aros")
  125. hitbox = NodePath("../Hitbox")
  126. [node name="SecondQuestReplacer" type="Node" parent="."]
  127. script = ExtResource("15_dpode")
  128. new_scene = "uid://doo8617qiyp77"
  129. metadata/_custom_type_script = "uid://d0mqkvopasu8k"
  130. [node name="TrackJoint" type="Node" parent="." node_paths=PackedStringArray("movement_node")]
  131. script = ExtResource("17_6o7qg")
  132. movement_node = NodePath("../BasicEnemyMovement")
  133. [node name="LevelPersistance" type="Node" parent="."]
  134. script = ExtResource("18_hkf3f")
  135. metadata/_custom_type_script = "uid://maqpreddu5kg"
  136. [connection signal="killed" from="." to="GibSpawner" method="summon_gib"]
  137. [connection signal="killed" from="." to="LevelPersistance" method="set_as_active" unbinds=1]
  138. [connection signal="invincible_player_hit" from="EnemyPlayerDetection" to="." method="die_from_object"]
  139. [connection signal="invincible_player_hit" from="EnemyPlayerDetection" to="ScoreNoteSpawner" method="spawn_note" binds= [100]]
  140. [connection signal="player_hit" from="EnemyPlayerDetection" to="." method="damage_player"]
  141. [connection signal="player_stomped_on" from="EnemyPlayerDetection" to="." method="stomped_on"]
  142. [connection signal="player_stomped_on" from="EnemyPlayerDetection" to="LevelPersistance" method="set_as_active" unbinds=1]
  143. [connection signal="block_bounced" from="BlockBouncingDetection" to="." method="die_from_object"]
  144. [connection signal="block_bounced" from="BlockBouncingDetection" to="ScoreNoteSpawner" method="spawn_note" binds= [100]]
  145. [connection signal="fireball_hit" from="FireballDetection" to="." method="die_from_object"]
  146. [connection signal="fireball_hit" from="FireballDetection" to="ScoreNoteSpawner" method="spawn_note" binds= [100]]
  147. [connection signal="moving_shell_entered" from="ShellDetection" to="." method="die_from_object"]
  148. [connection signal="icicle_detected" from="IcicleDetection" to="." method="die_from_object" flags=3]
  149. [connection signal="explosion_entered" from="ExplosionDetection" to="." method="die_from_object"]
  150. [connection signal="explosion_entered" from="ExplosionDetection" to="ScoreNoteSpawner" method="spawn_note" binds= [100]]
  151. [connection signal="enabled" from="LevelPersistance" to="." method="queue_free"]