DryBones.tscn 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. [gd_scene load_steps=25 format=3 uid="uid://bxsay5e6dhcqb"]
  2. [ext_resource type="Script" uid="uid://n123x5yuqpjd" path="res://Scripts/Classes/Entities/Enemies/DryBones.gd" id="1_8c647"]
  3. [ext_resource type="Texture2D" uid="uid://c5snfukhcacyf" path="res://Assets/Sprites/Enemies/DryBones.png" id="2_qya46"]
  4. [ext_resource type="Script" uid="uid://caq1qiwmy0mox" path="res://Scripts/Parts/BetterAnimatedSprite.gd" id="3_kio7v"]
  5. [ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="4_br3pe"]
  6. [ext_resource type="Script" uid="uid://chj8hu207lrh" path="res://Scripts/Classes/Components/EnemyPlayerDetection.gd" id="4_y8gga"]
  7. [ext_resource type="Script" uid="uid://dri2d5jtu0fbq" path="res://Scripts/Classes/Components/FireballDetection.gd" id="5_br3pe"]
  8. [ext_resource type="JSON" path="res://Assets/Sprites/Enemies/DryBones.json" id="5_l4h6l"]
  9. [ext_resource type="Script" uid="uid://bbww34oiexbx2" path="res://Scripts/Classes/Components/ShellDetection.gd" id="6_l4h6l"]
  10. [ext_resource type="Script" uid="uid://5octqlf4ohel" path="res://Scripts/Classes/Components/ScoreNoteSpawner.gd" id="7_qya46"]
  11. [ext_resource type="Script" uid="uid://dlq6o2rg1x7in" path="res://Scripts/Classes/Components/BasicEnemyMovement.gd" id="10_br3pe"]
  12. [ext_resource type="Script" uid="uid://ba18grqjixded" path="res://Scripts/Classes/Components/ExplosionDetection.gd" id="11_l4h6l"]
  13. [sub_resource type="AtlasTexture" id="AtlasTexture_w4qtl"]
  14. atlas = ExtResource("2_qya46")
  15. region = Rect2(48, 0, 24, 32)
  16. [sub_resource type="AtlasTexture" id="AtlasTexture_2ewll"]
  17. atlas = ExtResource("2_qya46")
  18. region = Rect2(72, 0, 24, 32)
  19. [sub_resource type="AtlasTexture" id="AtlasTexture_6txc0"]
  20. atlas = ExtResource("2_qya46")
  21. region = Rect2(72, 0, 24, 32)
  22. [sub_resource type="AtlasTexture" id="AtlasTexture_ihwve"]
  23. atlas = ExtResource("2_qya46")
  24. region = Rect2(48, 0, 24, 32)
  25. [sub_resource type="AtlasTexture" id="AtlasTexture_1jnbq"]
  26. atlas = ExtResource("2_qya46")
  27. region = Rect2(24, 0, 24, 32)
  28. [sub_resource type="AtlasTexture" id="AtlasTexture_g0gtr"]
  29. atlas = ExtResource("2_qya46")
  30. region = Rect2(0, 0, 24, 32)
  31. [sub_resource type="AtlasTexture" id="AtlasTexture_3rrs2"]
  32. atlas = ExtResource("2_qya46")
  33. region = Rect2(24, 0, 24, 32)
  34. [sub_resource type="SpriteFrames" id="SpriteFrames_bqbi3"]
  35. animations = [{
  36. "frames": [{
  37. "duration": 1.0,
  38. "texture": SubResource("AtlasTexture_w4qtl")
  39. }, {
  40. "duration": 1.0,
  41. "texture": SubResource("AtlasTexture_2ewll")
  42. }],
  43. "loop": false,
  44. "name": &"Crumble",
  45. "speed": 5.0
  46. }, {
  47. "frames": [{
  48. "duration": 1.0,
  49. "texture": SubResource("AtlasTexture_6txc0")
  50. }, {
  51. "duration": 1.0,
  52. "texture": SubResource("AtlasTexture_ihwve")
  53. }, {
  54. "duration": 1.0,
  55. "texture": SubResource("AtlasTexture_1jnbq")
  56. }],
  57. "loop": false,
  58. "name": &"GetUp",
  59. "speed": 5.0
  60. }, {
  61. "frames": [{
  62. "duration": 1.0,
  63. "texture": SubResource("AtlasTexture_g0gtr")
  64. }, {
  65. "duration": 1.0,
  66. "texture": SubResource("AtlasTexture_3rrs2")
  67. }],
  68. "loop": true,
  69. "name": &"Walk",
  70. "speed": 5.0
  71. }]
  72. [sub_resource type="RectangleShape2D" id="RectangleShape2D_cngyw"]
  73. size = Vector2(8, 8)
  74. [sub_resource type="RectangleShape2D" id="RectangleShape2D_tsi1c"]
  75. size = Vector2(12, 14)
  76. [sub_resource type="Animation" id="Animation_qya46"]
  77. length = 0.001
  78. tracks/0/type = "value"
  79. tracks/0/imported = false
  80. tracks/0/enabled = true
  81. tracks/0/path = NodePath("Sprite:offset")
  82. tracks/0/interp = 1
  83. tracks/0/loop_wrap = true
  84. tracks/0/keys = {
  85. "times": PackedFloat32Array(0),
  86. "transitions": PackedFloat32Array(1),
  87. "update": 0,
  88. "values": [Vector2(0, 1)]
  89. }
  90. [sub_resource type="Animation" id="Animation_8c647"]
  91. resource_name = "Shake"
  92. length = 0.1
  93. loop_mode = 2
  94. tracks/0/type = "value"
  95. tracks/0/imported = false
  96. tracks/0/enabled = true
  97. tracks/0/path = NodePath("Sprite:offset")
  98. tracks/0/interp = 2
  99. tracks/0/loop_wrap = true
  100. tracks/0/keys = {
  101. "times": PackedFloat32Array(0, 0.1),
  102. "transitions": PackedFloat32Array(1, 1),
  103. "update": 0,
  104. "values": [Vector2(-2, 1), Vector2(2, 1)]
  105. }
  106. [sub_resource type="AnimationLibrary" id="AnimationLibrary_kio7v"]
  107. _data = {
  108. &"RESET": SubResource("Animation_qya46"),
  109. &"Shake": SubResource("Animation_8c647")
  110. }
  111. [node name="DryBones" type="CharacterBody2D" node_paths=PackedStringArray("on_screen_enabler", "score_note_adder") groups=["Enemies"]]
  112. collision_layer = 16
  113. collision_mask = 50
  114. script = ExtResource("1_8c647")
  115. on_screen_enabler = NodePath("VisibleOnScreenEnabler2D")
  116. score_note_adder = NodePath("ScoreNoteSpawner")
  117. metadata/_custom_type_script = "uid://bpydbpyjk1mt4"
  118. [node name="Sprite" type="AnimatedSprite2D" parent="."]
  119. position = Vector2(0, -16)
  120. scale = Vector2(-1, 1)
  121. sprite_frames = SubResource("SpriteFrames_bqbi3")
  122. animation = &"Walk"
  123. autoplay = "Walk"
  124. offset = Vector2(0, 1)
  125. flip_h = true
  126. script = ExtResource("3_kio7v")
  127. metadata/_custom_type_script = "uid://caq1qiwmy0mox"
  128. [node name="ResourceSetterNew" type="Node" parent="Sprite" node_paths=PackedStringArray("node_to_affect")]
  129. script = ExtResource("4_br3pe")
  130. node_to_affect = NodePath("..")
  131. property_name = "sprite_frames"
  132. resource_json = ExtResource("5_l4h6l")
  133. metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
  134. [node name="LCollision" type="CollisionShape2D" parent="."]
  135. position = Vector2(0, -4)
  136. rotation = 1.5708
  137. shape = SubResource("RectangleShape2D_cngyw")
  138. one_way_collision = true
  139. [node name="RCollision" type="CollisionShape2D" parent="."]
  140. position = Vector2(0, -4)
  141. rotation = -1.5708
  142. shape = SubResource("RectangleShape2D_cngyw")
  143. one_way_collision = true
  144. [node name="Hitbox" type="Area2D" parent="."]
  145. [node name="Shape" type="CollisionShape2D" parent="Hitbox"]
  146. position = Vector2(0, -7)
  147. shape = SubResource("RectangleShape2D_tsi1c")
  148. [node name="EnemyPlayerDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  149. script = ExtResource("4_y8gga")
  150. hitbox = NodePath("../Hitbox")
  151. metadata/_custom_type_script = "uid://chj8hu207lrh"
  152. [node name="FireballDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  153. script = ExtResource("5_br3pe")
  154. hitbox = NodePath("../Hitbox")
  155. play_sfx_on_hit = true
  156. metadata/_custom_type_script = "uid://dri2d5jtu0fbq"
  157. [node name="ShellDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  158. script = ExtResource("6_l4h6l")
  159. hitbox = NodePath("../Hitbox")
  160. metadata/_custom_type_script = "uid://bbww34oiexbx2"
  161. [node name="ShakeAnimation" type="AnimationPlayer" parent="."]
  162. libraries = {
  163. &"": SubResource("AnimationLibrary_kio7v")
  164. }
  165. [node name="VisibleOnScreenEnabler2D" type="VisibleOnScreenEnabler2D" parent="."]
  166. position = Vector2(0, -9)
  167. rect = Rect2(-10, -13, 20, 23)
  168. [node name="ScoreNoteSpawner" type="Node" parent="."]
  169. script = ExtResource("7_qya46")
  170. metadata/_custom_type_script = "uid://5octqlf4ohel"
  171. [node name="BasicEnemyMovement" type="Node" parent="."]
  172. script = ExtResource("10_br3pe")
  173. [node name="ExplosionDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  174. script = ExtResource("11_l4h6l")
  175. hitbox = NodePath("../Hitbox")
  176. metadata/_custom_type_script = "uid://ba18grqjixded"
  177. [connection signal="killed" from="." to="." method="summon_particle" unbinds=1]
  178. [connection signal="invincible_player_hit" from="EnemyPlayerDetection" to="." method="die_from_object"]
  179. [connection signal="invincible_player_hit" from="EnemyPlayerDetection" to="ScoreNoteSpawner" method="spawn_note" binds= [200]]
  180. [connection signal="player_hit" from="EnemyPlayerDetection" to="." method="damage_player"]
  181. [connection signal="player_stomped_on" from="EnemyPlayerDetection" to="." method="stomped_on"]
  182. [connection signal="moving_shell_entered" from="ShellDetection" to="." method="die_from_object"]
  183. [connection signal="explosion_entered" from="ExplosionDetection" to="." method="die_from_object"]
  184. [connection signal="explosion_entered" from="ExplosionDetection" to="ScoreNoteSpawner" method="spawn_note" binds= [200]]