SideStepper.tscn 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. [gd_scene load_steps=22 format=3 uid="uid://cs40v66vkl6qi"]
  2. [ext_resource type="Script" uid="uid://dv18do583a3x0" path="res://Scripts/Classes/Entities/Enemies/Goomba.gd" id="1_vwosn"]
  3. [ext_resource type="Texture2D" uid="uid://caea5pxv4aawt" path="res://Assets/Sprites/Enemies/SideStepper.png" id="2_vwosn"]
  4. [ext_resource type="Script" uid="uid://caq1qiwmy0mox" path="res://Scripts/Parts/BetterAnimatedSprite.gd" id="3_qknq8"]
  5. [ext_resource type="JSON" path="res://Assets/Sprites/Enemies/SideStepper.json" id="5_7cy7x"]
  6. [ext_resource type="Script" uid="uid://chj8hu207lrh" path="res://Scripts/Classes/Components/EnemyPlayerDetection.gd" id="5_orhyp"]
  7. [ext_resource type="Script" uid="uid://c3gg32ivrlq8n" path="res://Scripts/Classes/Components/GibSpawner.gd" id="6_qknq8"]
  8. [ext_resource type="Script" uid="uid://cmg61722ktg2m" path="res://Scripts/Classes/Components/BlockBouncingDetection.gd" id="7_0qgy2"]
  9. [ext_resource type="Script" uid="uid://dri2d5jtu0fbq" path="res://Scripts/Classes/Components/FireballDetection.gd" id="8_5lh26"]
  10. [ext_resource type="Script" uid="uid://bbww34oiexbx2" path="res://Scripts/Classes/Components/ShellDetection.gd" id="9_22ule"]
  11. [ext_resource type="Script" uid="uid://5octqlf4ohel" path="res://Scripts/Classes/Components/ScoreNoteSpawner.gd" id="10_j1ueu"]
  12. [ext_resource type="Script" uid="uid://dq860i312isk" path="res://Scripts/Classes/Components/IcicleDetection.gd" id="11_bwulv"]
  13. [ext_resource type="Script" uid="uid://dlq6o2rg1x7in" path="res://Scripts/Classes/Components/BasicEnemyMovement.gd" id="12_sl01l"]
  14. [ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="14_0qgy2"]
  15. [ext_resource type="Script" uid="uid://ba18grqjixded" path="res://Scripts/Classes/Components/ExplosionDetection.gd" id="14_orhyp"]
  16. [sub_resource type="AtlasTexture" id="AtlasTexture_7cy7x"]
  17. atlas = ExtResource("2_vwosn")
  18. region = Rect2(32, 0, 16, 16)
  19. [sub_resource type="AtlasTexture" id="AtlasTexture_orhyp"]
  20. atlas = ExtResource("2_vwosn")
  21. region = Rect2(48, 0, 16, 16)
  22. [sub_resource type="AtlasTexture" id="AtlasTexture_22ule"]
  23. atlas = ExtResource("2_vwosn")
  24. region = Rect2(0, 0, 16, 16)
  25. [sub_resource type="AtlasTexture" id="AtlasTexture_j1ueu"]
  26. atlas = ExtResource("2_vwosn")
  27. region = Rect2(16, 0, 16, 16)
  28. [sub_resource type="SpriteFrames" id="SpriteFrames_877ec"]
  29. animations = [{
  30. "frames": [{
  31. "duration": 1.0,
  32. "texture": SubResource("AtlasTexture_7cy7x")
  33. }, {
  34. "duration": 1.0,
  35. "texture": SubResource("AtlasTexture_orhyp")
  36. }],
  37. "loop": true,
  38. "name": &"Angry",
  39. "speed": 10.0
  40. }, {
  41. "frames": [{
  42. "duration": 1.0,
  43. "texture": SubResource("AtlasTexture_22ule")
  44. }, {
  45. "duration": 1.0,
  46. "texture": SubResource("AtlasTexture_j1ueu")
  47. }],
  48. "loop": true,
  49. "name": &"Walk",
  50. "speed": 5.0
  51. }]
  52. [sub_resource type="RectangleShape2D" id="RectangleShape2D_e62ic"]
  53. size = Vector2(12, 12)
  54. [sub_resource type="RectangleShape2D" id="RectangleShape2D_qm5my"]
  55. size = Vector2(14, 14)
  56. [node name="SideStepper" type="CharacterBody2D" node_paths=PackedStringArray("on_screen_enabler", "score_note_adder") groups=["Enemies"]]
  57. collision_layer = 16
  58. collision_mask = 50
  59. script = ExtResource("1_vwosn")
  60. on_screen_enabler = NodePath("VisibleOnScreenEnabler2D")
  61. score_note_adder = NodePath("ScoreNoteSpawner")
  62. [node name="Sprite" type="AnimatedSprite2D" parent="."]
  63. position = Vector2(0, -8)
  64. sprite_frames = SubResource("SpriteFrames_877ec")
  65. animation = &"Walk"
  66. frame_progress = 0.9589298
  67. offset = Vector2(0, 1)
  68. script = ExtResource("3_qknq8")
  69. metadata/_custom_type_script = "uid://caq1qiwmy0mox"
  70. [node name="ResourceSetterNew" type="Node" parent="Sprite" node_paths=PackedStringArray("node_to_affect")]
  71. script = ExtResource("14_0qgy2")
  72. node_to_affect = NodePath("..")
  73. property_name = "sprite_frames"
  74. resource_json = ExtResource("5_7cy7x")
  75. metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
  76. [node name="LCollision" type="CollisionShape2D" parent="."]
  77. position = Vector2(0, -6)
  78. rotation = 1.5707964
  79. shape = SubResource("RectangleShape2D_e62ic")
  80. one_way_collision = true
  81. [node name="RCollision" type="CollisionShape2D" parent="."]
  82. position = Vector2(0, -6)
  83. rotation = -1.5707964
  84. shape = SubResource("RectangleShape2D_e62ic")
  85. one_way_collision = true
  86. [node name="Hitbox" type="Area2D" parent="."]
  87. [node name="Shape" type="CollisionShape2D" parent="Hitbox"]
  88. visible = false
  89. position = Vector2(0, -7)
  90. shape = SubResource("RectangleShape2D_qm5my")
  91. [node name="EnemyPlayerDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  92. script = ExtResource("5_orhyp")
  93. hitbox = NodePath("../Hitbox")
  94. [node name="VisibleOnScreenEnabler2D" type="VisibleOnScreenEnabler2D" parent="."]
  95. self_modulate = Color(1, 1, 1, 0)
  96. position = Vector2(0, -8)
  97. [node name="GibSpawner" type="Node" parent="." node_paths=PackedStringArray("visuals")]
  98. script = ExtResource("6_qknq8")
  99. visuals = NodePath("../Sprite")
  100. [node name="BlockBouncingDetection" type="Node" parent="."]
  101. script = ExtResource("7_0qgy2")
  102. [node name="FireballDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  103. script = ExtResource("8_5lh26")
  104. hitbox = NodePath("../Hitbox")
  105. [node name="ShellDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  106. script = ExtResource("9_22ule")
  107. hitbox = NodePath("../Hitbox")
  108. metadata/_custom_type_script = "uid://bbww34oiexbx2"
  109. [node name="ScoreNoteSpawner" type="Node" parent="."]
  110. script = ExtResource("10_j1ueu")
  111. add_score = true
  112. [node name="IcicleDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  113. script = ExtResource("11_bwulv")
  114. hitbox = NodePath("../Hitbox")
  115. [node name="BasicEnemyMovement" type="Node" parent="."]
  116. script = ExtResource("12_sl01l")
  117. metadata/_custom_type_script = "uid://dlq6o2rg1x7in"
  118. [node name="ExplosionDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  119. script = ExtResource("14_orhyp")
  120. hitbox = NodePath("../Hitbox")
  121. metadata/_custom_type_script = "uid://ba18grqjixded"
  122. [connection signal="killed" from="." to="GibSpawner" method="summon_gib"]
  123. [connection signal="invincible_player_hit" from="EnemyPlayerDetection" to="." method="die_from_object"]
  124. [connection signal="invincible_player_hit" from="EnemyPlayerDetection" to="ScoreNoteSpawner" method="spawn_note" binds= [100]]
  125. [connection signal="player_hit" from="EnemyPlayerDetection" to="." method="damage_player"]
  126. [connection signal="player_stomped_on" from="EnemyPlayerDetection" to="." method="damage_player"]
  127. [connection signal="block_bounced" from="BlockBouncingDetection" to="." method="damage"]
  128. [connection signal="fireball_hit" from="FireballDetection" to="." method="damage"]
  129. [connection signal="moving_shell_entered" from="ShellDetection" to="." method="die_from_object"]
  130. [connection signal="icicle_detected" from="IcicleDetection" to="." method="die_from_object"]
  131. [connection signal="explosion_entered" from="ExplosionDetection" to="." method="die_from_object"]
  132. [connection signal="explosion_entered" from="ExplosionDetection" to="ScoreNoteSpawner" method="spawn_note" binds= [200]]