GreenKoopaShell.tscn 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. [gd_scene load_steps=22 format=3 uid="uid://bowadxqfmg636"]
  2. [ext_resource type="Script" uid="uid://b0mk8rdwt73w0" path="res://Scripts/Classes/Entities/ShellClass.gd" id="1_diywd"]
  3. [ext_resource type="Texture2D" uid="uid://cy6v7tdtxebs5" path="res://Assets/Sprites/Enemies/KoopaTroopa.png" id="2_hddfq"]
  4. [ext_resource type="Script" uid="uid://caq1qiwmy0mox" path="res://Scripts/Parts/BetterAnimatedSprite.gd" id="2_y03il"]
  5. [ext_resource type="Script" uid="uid://chj8hu207lrh" path="res://Scripts/Classes/Components/EnemyPlayerDetection.gd" id="3_6e771"]
  6. [ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="3_hddfq"]
  7. [ext_resource type="JSON" path="res://Assets/Sprites/Enemies/GreenKoopaShell.json" id="4_y03il"]
  8. [ext_resource type="Script" uid="uid://5octqlf4ohel" path="res://Scripts/Classes/Components/ScoreNoteSpawner.gd" id="4_ygks6"]
  9. [ext_resource type="Script" uid="uid://c3gg32ivrlq8n" path="res://Scripts/Classes/Components/GibSpawner.gd" id="7_03ndt"]
  10. [ext_resource type="Script" uid="uid://bbww34oiexbx2" path="res://Scripts/Classes/Components/ShellDetection.gd" id="8_0nmd6"]
  11. [ext_resource type="Script" uid="uid://dri2d5jtu0fbq" path="res://Scripts/Classes/Components/FireballDetection.gd" id="9_8vmgs"]
  12. [ext_resource type="Script" uid="uid://cmg61722ktg2m" path="res://Scripts/Classes/Components/BlockBouncingDetection.gd" id="10_y03il"]
  13. [sub_resource type="AtlasTexture" id="AtlasTexture_oqwce"]
  14. atlas = ExtResource("2_hddfq")
  15. region = Rect2(32, 16, 16, 16)
  16. [sub_resource type="AtlasTexture" id="AtlasTexture_80wu4"]
  17. atlas = ExtResource("2_hddfq")
  18. region = Rect2(48, 16, 16, 16)
  19. [sub_resource type="AtlasTexture" id="AtlasTexture_rvngx"]
  20. atlas = ExtResource("2_hddfq")
  21. region = Rect2(64, 16, 16, 16)
  22. [sub_resource type="AtlasTexture" id="AtlasTexture_amsp7"]
  23. atlas = ExtResource("2_hddfq")
  24. region = Rect2(80, 16, 16, 16)
  25. [sub_resource type="AtlasTexture" id="AtlasTexture_hqtjl"]
  26. atlas = ExtResource("2_hddfq")
  27. region = Rect2(32, 16, 16, 16)
  28. [sub_resource type="AtlasTexture" id="AtlasTexture_u5jpg"]
  29. atlas = ExtResource("2_hddfq")
  30. region = Rect2(32, 0, 16, 16)
  31. [sub_resource type="AtlasTexture" id="AtlasTexture_j2gdr"]
  32. atlas = ExtResource("2_hddfq")
  33. region = Rect2(32, 16, 16, 16)
  34. [sub_resource type="SpriteFrames" id="SpriteFrames_5qj7r"]
  35. animations = [{
  36. "frames": [{
  37. "duration": 1.0,
  38. "texture": SubResource("AtlasTexture_oqwce")
  39. }],
  40. "loop": true,
  41. "name": &"Idle",
  42. "speed": 5.0
  43. }, {
  44. "frames": [{
  45. "duration": 1.0,
  46. "texture": SubResource("AtlasTexture_80wu4")
  47. }, {
  48. "duration": 1.0,
  49. "texture": SubResource("AtlasTexture_rvngx")
  50. }, {
  51. "duration": 1.0,
  52. "texture": SubResource("AtlasTexture_amsp7")
  53. }, {
  54. "duration": 1.0,
  55. "texture": SubResource("AtlasTexture_hqtjl")
  56. }],
  57. "loop": true,
  58. "name": &"Spin",
  59. "speed": 15.0
  60. }, {
  61. "frames": [{
  62. "duration": 1.0,
  63. "texture": SubResource("AtlasTexture_u5jpg")
  64. }, {
  65. "duration": 1.0,
  66. "texture": SubResource("AtlasTexture_j2gdr")
  67. }],
  68. "loop": true,
  69. "name": &"Wake",
  70. "speed": 5.0
  71. }]
  72. [sub_resource type="RectangleShape2D" id="RectangleShape2D_03ndt"]
  73. size = Vector2(12, 12)
  74. [sub_resource type="RectangleShape2D" id="RectangleShape2D_hddfq"]
  75. size = Vector2(16, 12)
  76. [node name="GreenKoopaShell" type="CharacterBody2D" node_paths=PackedStringArray("on_screen_enabler", "score_note_adder") groups=["Enemies"]]
  77. collision_layer = 32
  78. collision_mask = 6
  79. floor_constant_speed = true
  80. floor_max_angle = 0.80285144
  81. floor_snap_length = 4.0
  82. script = ExtResource("1_diywd")
  83. on_screen_enabler = NodePath("VisibleOnScreenEnabler2D")
  84. score_note_adder = NodePath("ScoreNoteSpawner")
  85. [node name="Sprite" type="AnimatedSprite2D" parent="."]
  86. position = Vector2(0, -8)
  87. sprite_frames = SubResource("SpriteFrames_5qj7r")
  88. animation = &"Spin"
  89. frame = 3
  90. frame_progress = 0.781081
  91. offset = Vector2(0, 1)
  92. script = ExtResource("2_y03il")
  93. metadata/_custom_type_script = "uid://caq1qiwmy0mox"
  94. [node name="ResourceSetterNew" type="Node" parent="Sprite" node_paths=PackedStringArray("node_to_affect")]
  95. script = ExtResource("3_hddfq")
  96. node_to_affect = NodePath("..")
  97. property_name = "sprite_frames"
  98. resource_json = ExtResource("4_y03il")
  99. metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
  100. [node name="LCollision" type="CollisionShape2D" parent="."]
  101. position = Vector2(0, -6)
  102. rotation = 1.5708
  103. shape = SubResource("RectangleShape2D_03ndt")
  104. one_way_collision = true
  105. [node name="RCollision" type="CollisionShape2D" parent="."]
  106. position = Vector2(0, -6)
  107. rotation = -1.5708
  108. shape = SubResource("RectangleShape2D_03ndt")
  109. one_way_collision = true
  110. [node name="Hitbox" type="Area2D" parent="."]
  111. collision_mask = 5
  112. [node name="Collision" type="CollisionShape2D" parent="Hitbox"]
  113. position = Vector2(0, -6)
  114. shape = SubResource("RectangleShape2D_hddfq")
  115. [node name="EnemyPlayerDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  116. script = ExtResource("3_6e771")
  117. hitbox = NodePath("../Hitbox")
  118. metadata/_custom_type_script = "uid://chj8hu207lrh"
  119. [node name="ScoreNoteSpawner" type="Node" parent="."]
  120. script = ExtResource("4_ygks6")
  121. add_score = true
  122. metadata/_custom_type_script = "uid://5octqlf4ohel"
  123. [node name="GibSpawner" type="Node" parent="." node_paths=PackedStringArray("visuals")]
  124. script = ExtResource("7_03ndt")
  125. visuals = NodePath("../Sprite")
  126. metadata/_custom_type_script = "uid://c3gg32ivrlq8n"
  127. [node name="ShellDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  128. script = ExtResource("8_0nmd6")
  129. hitbox = NodePath("../Hitbox")
  130. metadata/_custom_type_script = "uid://bbww34oiexbx2"
  131. [node name="FireballDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  132. script = ExtResource("9_8vmgs")
  133. hitbox = NodePath("../Hitbox")
  134. metadata/_custom_type_script = "uid://dri2d5jtu0fbq"
  135. [node name="BlockBouncingDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  136. script = ExtResource("10_y03il")
  137. hitbox = NodePath("../Hitbox")
  138. metadata/_custom_type_script = "uid://cmg61722ktg2m"
  139. [node name="VisibleOnScreenEnabler2D" type="VisibleOnScreenEnabler2D" parent="."]
  140. position = Vector2(0, -8)
  141. scale = Vector2(1, 0.98723614)
  142. rect = Rect2(-128, -128, 256, 256)
  143. [connection signal="killed" from="." to="GibSpawner" method="summon_gib"]
  144. [connection signal="area_entered" from="Hitbox" to="." method="on_area_entered"]
  145. [connection signal="invincible_player_hit" from="EnemyPlayerDetection" to="." method="die_from_object"]
  146. [connection signal="invincible_player_hit" from="EnemyPlayerDetection" to="ScoreNoteSpawner" method="spawn_note" binds= [200]]
  147. [connection signal="player_hit" from="EnemyPlayerDetection" to="." method="on_player_hit"]
  148. [connection signal="player_stomped_on" from="EnemyPlayerDetection" to="." method="on_player_stomped_on"]
  149. [connection signal="moving_shell_entered" from="ShellDetection" to="." method="die_from_object"]
  150. [connection signal="fireball_hit" from="FireballDetection" to="." method="die_from_object"]
  151. [connection signal="fireball_hit" from="FireballDetection" to="ScoreNoteSpawner" method="spawn_note" binds= [200]]
  152. [connection signal="block_bounced" from="BlockBouncingDetection" to="." method="block_bounced"]
  153. [connection signal="screen_exited" from="VisibleOnScreenEnabler2D" to="." method="queue_free"]