Spiny.tscn 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. [gd_scene load_steps=22 format=3 uid="uid://dinpjmg0q23rv"]
  2. [ext_resource type="Script" uid="uid://bds7rntb0btee" path="res://Scripts/Classes/Entities/Enemies/Spiny.gd" id="1_u8w4p"]
  3. [ext_resource type="Texture2D" uid="uid://diemx33h3bxa2" path="res://Assets/Sprites/Enemies/Spiny.png" id="2_u8w4p"]
  4. [ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="3_velug"]
  5. [ext_resource type="JSON" path="res://Assets/Sprites/Enemies/Spiny.json" id="4_a74i7"]
  6. [ext_resource type="Script" uid="uid://chj8hu207lrh" path="res://Scripts/Classes/Components/EnemyPlayerDetection.gd" id="4_qcd6q"]
  7. [ext_resource type="Script" uid="uid://c3gg32ivrlq8n" path="res://Scripts/Classes/Components/GibSpawner.gd" id="5_f6841"]
  8. [ext_resource type="Script" uid="uid://bbww34oiexbx2" path="res://Scripts/Classes/Components/ShellDetection.gd" id="6_velug"]
  9. [ext_resource type="Script" uid="uid://dri2d5jtu0fbq" path="res://Scripts/Classes/Components/FireballDetection.gd" id="7_a74i7"]
  10. [ext_resource type="Script" uid="uid://cmg61722ktg2m" path="res://Scripts/Classes/Components/BlockBouncingDetection.gd" id="8_j3bt6"]
  11. [ext_resource type="Script" uid="uid://dlq6o2rg1x7in" path="res://Scripts/Classes/Components/BasicEnemyMovement.gd" id="10_a74i7"]
  12. [ext_resource type="Script" uid="uid://ba18grqjixded" path="res://Scripts/Classes/Components/ExplosionDetection.gd" id="11_yhsi8"]
  13. [ext_resource type="Script" uid="uid://5octqlf4ohel" path="res://Scripts/Classes/Components/ScoreNoteSpawner.gd" id="12_7f13k"]
  14. [ext_resource type="Script" uid="uid://d4a7yp6e55u8t" path="res://Scripts/Classes/Components/TrackJoint.gd" id="13_7f13k"]
  15. [ext_resource type="Script" uid="uid://33no4mylhh1r" path="res://Scripts/Classes/Components/OffScreenDespawner.gd" id="14_878x2"]
  16. [sub_resource type="AtlasTexture" id="AtlasTexture_evl61"]
  17. atlas = ExtResource("2_u8w4p")
  18. region = Rect2(0, 0, 16, 16)
  19. [sub_resource type="AtlasTexture" id="AtlasTexture_s2w10"]
  20. atlas = ExtResource("2_u8w4p")
  21. region = Rect2(16, 0, 16, 16)
  22. [sub_resource type="AtlasTexture" id="AtlasTexture_qcd6q"]
  23. atlas = ExtResource("2_u8w4p")
  24. region = Rect2(0, 16, 16, 16)
  25. [sub_resource type="AtlasTexture" id="AtlasTexture_r3qkt"]
  26. atlas = ExtResource("2_u8w4p")
  27. region = Rect2(16, 16, 16, 16)
  28. [sub_resource type="SpriteFrames" id="SpriteFrames_evl61"]
  29. animations = [{
  30. "frames": [{
  31. "duration": 1.0,
  32. "texture": SubResource("AtlasTexture_evl61")
  33. }, {
  34. "duration": 1.0,
  35. "texture": SubResource("AtlasTexture_s2w10")
  36. }],
  37. "loop": true,
  38. "name": &"Egg",
  39. "speed": 10.0
  40. }, {
  41. "frames": [{
  42. "duration": 1.0,
  43. "texture": SubResource("AtlasTexture_qcd6q")
  44. }, {
  45. "duration": 1.0,
  46. "texture": SubResource("AtlasTexture_r3qkt")
  47. }],
  48. "loop": true,
  49. "name": &"Walk",
  50. "speed": 5.0
  51. }]
  52. [sub_resource type="RectangleShape2D" id="RectangleShape2D_s2w10"]
  53. custom_solver_bias = 1.0
  54. size = Vector2(10, 8)
  55. [sub_resource type="RectangleShape2D" id="RectangleShape2D_f6841"]
  56. custom_solver_bias = 1.0
  57. size = Vector2(10, 10)
  58. [node name="Spiny" type="CharacterBody2D" node_paths=PackedStringArray("on_screen_enabler", "score_note_adder") groups=["Enemies"]]
  59. collision_layer = 16
  60. collision_mask = 50
  61. script = ExtResource("1_u8w4p")
  62. on_screen_enabler = NodePath("VisibleOnScreenEnabler2D")
  63. score_note_adder = NodePath("ScoreNoteSpawner")
  64. metadata/_custom_type_script = "uid://bpydbpyjk1mt4"
  65. [node name="Sprite" type="AnimatedSprite2D" parent="."]
  66. position = Vector2(0, -8)
  67. scale = Vector2(-1, 1)
  68. sprite_frames = SubResource("SpriteFrames_evl61")
  69. animation = &"Walk"
  70. autoplay = "Walk"
  71. offset = Vector2(0, 1)
  72. flip_h = true
  73. [node name="ResourceSetterNew" type="Node" parent="Sprite" node_paths=PackedStringArray("node_to_affect")]
  74. script = ExtResource("3_velug")
  75. node_to_affect = NodePath("..")
  76. property_name = "sprite_frames"
  77. resource_json = ExtResource("4_a74i7")
  78. metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
  79. [node name="Hitbox" type="Area2D" parent="."]
  80. [node name="Shape" type="CollisionShape2D" parent="Hitbox"]
  81. position = Vector2(0, -4)
  82. shape = SubResource("RectangleShape2D_s2w10")
  83. [node name="RCollision" type="CollisionShape2D" parent="."]
  84. visible = false
  85. position = Vector2(0, -5)
  86. rotation = 1.5708
  87. shape = SubResource("RectangleShape2D_f6841")
  88. one_way_collision = true
  89. [node name="LCollision" type="CollisionShape2D" parent="."]
  90. visible = false
  91. position = Vector2(0, -5)
  92. rotation = -1.5708
  93. shape = SubResource("RectangleShape2D_f6841")
  94. one_way_collision = true
  95. [node name="EnemyPlayerDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  96. script = ExtResource("4_qcd6q")
  97. hitbox = NodePath("../Hitbox")
  98. metadata/_custom_type_script = "uid://chj8hu207lrh"
  99. [node name="VisibleOnScreenEnabler2D" type="VisibleOnScreenEnabler2D" parent="."]
  100. position = Vector2(0, -8)
  101. [node name="GibSpawner" type="Node" parent="." node_paths=PackedStringArray("visuals")]
  102. script = ExtResource("5_f6841")
  103. visuals = NodePath("../Sprite")
  104. metadata/_custom_type_script = "uid://c3gg32ivrlq8n"
  105. [node name="ShellDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  106. script = ExtResource("6_velug")
  107. hitbox = NodePath("../Hitbox")
  108. metadata/_custom_type_script = "uid://bbww34oiexbx2"
  109. [node name="FireballDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  110. script = ExtResource("7_a74i7")
  111. hitbox = NodePath("../Hitbox")
  112. metadata/_custom_type_script = "uid://dri2d5jtu0fbq"
  113. [node name="BlockBouncingDetection" type="Node" parent="."]
  114. script = ExtResource("8_j3bt6")
  115. metadata/_custom_type_script = "uid://cmg61722ktg2m"
  116. [node name="BasicEnemyMovement" type="Node" parent="."]
  117. script = ExtResource("10_a74i7")
  118. [node name="ExplosionDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  119. script = ExtResource("11_yhsi8")
  120. hitbox = NodePath("../Hitbox")
  121. [node name="ScoreNoteSpawner" type="Node" parent="."]
  122. script = ExtResource("12_7f13k")
  123. add_score = true
  124. metadata/_custom_type_script = "uid://5octqlf4ohel"
  125. [node name="TrackJoint" type="Node" parent="." node_paths=PackedStringArray("movement_node")]
  126. script = ExtResource("13_7f13k")
  127. movement_node = NodePath("../BasicEnemyMovement")
  128. metadata/_custom_type_script = "uid://d4a7yp6e55u8t"
  129. [node name="OffScreenDespawner" type="Node" parent="."]
  130. script = ExtResource("14_878x2")
  131. metadata/_custom_type_script = "uid://33no4mylhh1r"
  132. [connection signal="killed" from="." to="GibSpawner" method="summon_gib"]
  133. [connection signal="invincible_player_hit" from="EnemyPlayerDetection" to="." method="die_from_object"]
  134. [connection signal="invincible_player_hit" from="EnemyPlayerDetection" to="ScoreNoteSpawner" method="spawn_note" binds= [200]]
  135. [connection signal="player_hit" from="EnemyPlayerDetection" to="." method="damage_player"]
  136. [connection signal="player_stomped_on" from="EnemyPlayerDetection" to="." method="damage_player"]
  137. [connection signal="screen_exited" from="VisibleOnScreenEnabler2D" to="OffScreenDespawner" method="on_screen_exited"]
  138. [connection signal="moving_shell_entered" from="ShellDetection" to="." method="die_from_object"]
  139. [connection signal="fireball_hit" from="FireballDetection" to="." method="die_from_object"]
  140. [connection signal="fireball_hit" from="FireballDetection" to="ScoreNoteSpawner" method="spawn_note" binds= [200]]
  141. [connection signal="block_bounced" from="BlockBouncingDetection" to="." method="die_from_object"]
  142. [connection signal="block_bounced" from="BlockBouncingDetection" to="ScoreNoteSpawner" method="spawn_note" binds= [200]]
  143. [connection signal="explosion_entered" from="ExplosionDetection" to="." method="die_from_object"]
  144. [connection signal="explosion_entered" from="ExplosionDetection" to="ScoreNoteSpawner" method="spawn_note" binds= [200]]