Pokey.tscn 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386
  1. [gd_scene load_steps=22 format=3 uid="uid://beggmeixrin75"]
  2. [ext_resource type="Script" uid="uid://b1b6aiai213ci" path="res://Scripts/Classes/Entities/Enemies/Pokey.gd" id="1_b54ls"]
  3. [ext_resource type="Texture2D" uid="uid://dj46y8vhqlqjw" path="res://Assets/Sprites/Enemies/Pokey.png" id="2_8aome"]
  4. [ext_resource type="Script" uid="uid://caq1qiwmy0mox" path="res://Scripts/Parts/BetterAnimatedSprite.gd" id="3_b54ls"]
  5. [ext_resource type="Script" uid="uid://c3gg32ivrlq8n" path="res://Scripts/Classes/Components/GibSpawner.gd" id="4_30hxr"]
  6. [ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="4_bjt0v"]
  7. [ext_resource type="JSON" path="res://Assets/Sprites/Enemies/Pokey.json" id="5_rjgwh"]
  8. [ext_resource type="Script" uid="uid://dri2d5jtu0fbq" path="res://Scripts/Classes/Components/FireballDetection.gd" id="5_t1h12"]
  9. [ext_resource type="Script" uid="uid://chj8hu207lrh" path="res://Scripts/Classes/Components/EnemyPlayerDetection.gd" id="6_bjt0v"]
  10. [ext_resource type="Script" uid="uid://bbww34oiexbx2" path="res://Scripts/Classes/Components/ShellDetection.gd" id="7_rjgwh"]
  11. [ext_resource type="Script" uid="uid://dq860i312isk" path="res://Scripts/Classes/Components/IcicleDetection.gd" id="8_1jb5g"]
  12. [ext_resource type="Script" uid="uid://cmg61722ktg2m" path="res://Scripts/Classes/Components/BlockBouncingDetection.gd" id="9_klwvr"]
  13. [ext_resource type="Script" uid="uid://ba18grqjixded" path="res://Scripts/Classes/Components/ExplosionDetection.gd" id="10_wuthq"]
  14. [ext_resource type="Script" uid="uid://dlq6o2rg1x7in" path="res://Scripts/Classes/Components/BasicEnemyMovement.gd" id="11_8aome"]
  15. [ext_resource type="Script" uid="uid://5octqlf4ohel" path="res://Scripts/Classes/Components/ScoreNoteSpawner.gd" id="12_b54ls"]
  16. [ext_resource type="Script" uid="uid://ctfbuoxtnnl0q" path="res://Scripts/Classes/Components/EditorPropertyExposer.gd" id="13_30hxr"]
  17. [sub_resource type="AtlasTexture" id="AtlasTexture_g6vo0"]
  18. atlas = ExtResource("2_8aome")
  19. region = Rect2(32, 0, 32, 32)
  20. [sub_resource type="AtlasTexture" id="AtlasTexture_usxvm"]
  21. atlas = ExtResource("2_8aome")
  22. region = Rect2(0, 0, 32, 32)
  23. [sub_resource type="SpriteFrames" id="SpriteFrames_86hsc"]
  24. animations = [{
  25. "frames": [{
  26. "duration": 1.0,
  27. "texture": SubResource("AtlasTexture_g6vo0")
  28. }],
  29. "loop": true,
  30. "name": &"Body",
  31. "speed": 5.0
  32. }, {
  33. "frames": [{
  34. "duration": 1.0,
  35. "texture": SubResource("AtlasTexture_usxvm")
  36. }],
  37. "loop": true,
  38. "name": &"Head",
  39. "speed": 5.0
  40. }]
  41. [sub_resource type="RectangleShape2D" id="RectangleShape2D_rjgwh"]
  42. resource_local_to_scene = true
  43. size = Vector2(12, 16)
  44. [sub_resource type="RectangleShape2D" id="RectangleShape2D_mpg4k"]
  45. size = Vector2(12, 12)
  46. [sub_resource type="GDScript" id="GDScript_30hxr"]
  47. script/source = "extends Node
  48. func _process(delta: float) -> void:
  49. for i in %Parts.get_child_count():
  50. var node = %Parts.get_child(i)
  51. node.visible = i <= owner.length - 1
  52. node.play(\"Head\" if i == owner.length - 1 else \"Body\")
  53. "
  54. [node name="Pokey" type="CharacterBody2D" node_paths=PackedStringArray("on_screen_enabler", "score_note_adder") groups=["Enemies"]]
  55. collision_layer = 16
  56. collision_mask = 50
  57. script = ExtResource("1_b54ls")
  58. on_screen_enabler = NodePath("VisibleOnScreenEnabler2D")
  59. score_note_adder = NodePath("ScoreNoteSpawner")
  60. metadata/_custom_type_script = "uid://bpydbpyjk1mt4"
  61. [node name="Parts" type="Node2D" parent="."]
  62. unique_name_in_owner = true
  63. position = Vector2(0, -8)
  64. scale = Vector2(-1, 1)
  65. [node name="Part1" type="AnimatedSprite2D" parent="Parts"]
  66. sprite_frames = SubResource("SpriteFrames_86hsc")
  67. animation = &"Body"
  68. flip_h = true
  69. script = ExtResource("3_b54ls")
  70. do_offset = false
  71. metadata/_custom_type_script = "uid://caq1qiwmy0mox"
  72. [node name="ResourceSetterNew" type="Node" parent="Parts/Part1" node_paths=PackedStringArray("node_to_affect")]
  73. script = ExtResource("4_bjt0v")
  74. node_to_affect = NodePath("..")
  75. property_name = "sprite_frames"
  76. resource_json = ExtResource("5_rjgwh")
  77. metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
  78. [node name="GibSpawner" type="Node" parent="Parts/Part1" node_paths=PackedStringArray("visuals")]
  79. script = ExtResource("4_30hxr")
  80. visuals = NodePath("..")
  81. metadata/_custom_type_script = "uid://c3gg32ivrlq8n"
  82. [node name="Part2" type="AnimatedSprite2D" parent="Parts"]
  83. position = Vector2(0, -16)
  84. sprite_frames = SubResource("SpriteFrames_86hsc")
  85. animation = &"Body"
  86. flip_h = true
  87. script = ExtResource("3_b54ls")
  88. do_offset = false
  89. metadata/_custom_type_script = "uid://caq1qiwmy0mox"
  90. [node name="ResourceSetterNew" type="Node" parent="Parts/Part2" node_paths=PackedStringArray("node_to_affect")]
  91. script = ExtResource("4_bjt0v")
  92. node_to_affect = NodePath("..")
  93. property_name = "sprite_frames"
  94. resource_json = ExtResource("5_rjgwh")
  95. metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
  96. [node name="GibSpawner" type="Node" parent="Parts/Part2" node_paths=PackedStringArray("visuals")]
  97. script = ExtResource("4_30hxr")
  98. visuals = NodePath("..")
  99. play_death_sfx = false
  100. metadata/_custom_type_script = "uid://c3gg32ivrlq8n"
  101. [node name="Part3" type="AnimatedSprite2D" parent="Parts"]
  102. position = Vector2(0, -32)
  103. sprite_frames = SubResource("SpriteFrames_86hsc")
  104. animation = &"Head"
  105. flip_h = true
  106. script = ExtResource("3_b54ls")
  107. do_offset = false
  108. metadata/_custom_type_script = "uid://caq1qiwmy0mox"
  109. [node name="ResourceSetterNew" type="Node" parent="Parts/Part3" node_paths=PackedStringArray("node_to_affect")]
  110. script = ExtResource("4_bjt0v")
  111. node_to_affect = NodePath("..")
  112. property_name = "sprite_frames"
  113. resource_json = ExtResource("5_rjgwh")
  114. metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
  115. [node name="GibSpawner" type="Node" parent="Parts/Part3" node_paths=PackedStringArray("visuals")]
  116. script = ExtResource("4_30hxr")
  117. visuals = NodePath("..")
  118. play_death_sfx = false
  119. metadata/_custom_type_script = "uid://c3gg32ivrlq8n"
  120. [node name="Part4" type="AnimatedSprite2D" parent="Parts"]
  121. visible = false
  122. position = Vector2(0, -48)
  123. sprite_frames = SubResource("SpriteFrames_86hsc")
  124. animation = &"Head"
  125. flip_h = true
  126. script = ExtResource("3_b54ls")
  127. do_offset = false
  128. metadata/_custom_type_script = "uid://caq1qiwmy0mox"
  129. [node name="ResourceSetterNew" type="Node" parent="Parts/Part4" node_paths=PackedStringArray("node_to_affect")]
  130. script = ExtResource("4_bjt0v")
  131. node_to_affect = NodePath("..")
  132. property_name = "sprite_frames"
  133. resource_json = ExtResource("5_rjgwh")
  134. metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
  135. [node name="GibSpawner" type="Node" parent="Parts/Part4" node_paths=PackedStringArray("visuals")]
  136. script = ExtResource("4_30hxr")
  137. visuals = NodePath("..")
  138. play_death_sfx = false
  139. metadata/_custom_type_script = "uid://c3gg32ivrlq8n"
  140. [node name="Part5" type="AnimatedSprite2D" parent="Parts"]
  141. visible = false
  142. position = Vector2(0, -64)
  143. sprite_frames = SubResource("SpriteFrames_86hsc")
  144. animation = &"Head"
  145. flip_h = true
  146. script = ExtResource("3_b54ls")
  147. do_offset = false
  148. metadata/_custom_type_script = "uid://caq1qiwmy0mox"
  149. [node name="ResourceSetterNew" type="Node" parent="Parts/Part5" node_paths=PackedStringArray("node_to_affect")]
  150. script = ExtResource("4_bjt0v")
  151. node_to_affect = NodePath("..")
  152. property_name = "sprite_frames"
  153. resource_json = ExtResource("5_rjgwh")
  154. metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
  155. [node name="GibSpawner" type="Node" parent="Parts/Part5" node_paths=PackedStringArray("visuals")]
  156. script = ExtResource("4_30hxr")
  157. visuals = NodePath("..")
  158. play_death_sfx = false
  159. metadata/_custom_type_script = "uid://c3gg32ivrlq8n"
  160. [node name="Part6" type="AnimatedSprite2D" parent="Parts"]
  161. visible = false
  162. position = Vector2(0, -80)
  163. sprite_frames = SubResource("SpriteFrames_86hsc")
  164. animation = &"Head"
  165. flip_h = true
  166. script = ExtResource("3_b54ls")
  167. do_offset = false
  168. metadata/_custom_type_script = "uid://caq1qiwmy0mox"
  169. [node name="ResourceSetterNew" type="Node" parent="Parts/Part6" node_paths=PackedStringArray("node_to_affect")]
  170. script = ExtResource("4_bjt0v")
  171. node_to_affect = NodePath("..")
  172. property_name = "sprite_frames"
  173. resource_json = ExtResource("5_rjgwh")
  174. metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
  175. [node name="GibSpawner" type="Node" parent="Parts/Part6" node_paths=PackedStringArray("visuals")]
  176. script = ExtResource("4_30hxr")
  177. visuals = NodePath("..")
  178. play_death_sfx = false
  179. metadata/_custom_type_script = "uid://c3gg32ivrlq8n"
  180. [node name="Part7" type="AnimatedSprite2D" parent="Parts"]
  181. visible = false
  182. position = Vector2(0, -96)
  183. sprite_frames = SubResource("SpriteFrames_86hsc")
  184. animation = &"Head"
  185. flip_h = true
  186. script = ExtResource("3_b54ls")
  187. do_offset = false
  188. metadata/_custom_type_script = "uid://caq1qiwmy0mox"
  189. [node name="ResourceSetterNew" type="Node" parent="Parts/Part7" node_paths=PackedStringArray("node_to_affect")]
  190. script = ExtResource("4_bjt0v")
  191. node_to_affect = NodePath("..")
  192. property_name = "sprite_frames"
  193. resource_json = ExtResource("5_rjgwh")
  194. metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
  195. [node name="GibSpawner" type="Node" parent="Parts/Part7" node_paths=PackedStringArray("visuals")]
  196. script = ExtResource("4_30hxr")
  197. visuals = NodePath("..")
  198. play_death_sfx = false
  199. metadata/_custom_type_script = "uid://c3gg32ivrlq8n"
  200. [node name="Part8" type="AnimatedSprite2D" parent="Parts"]
  201. visible = false
  202. position = Vector2(0, -112)
  203. sprite_frames = SubResource("SpriteFrames_86hsc")
  204. animation = &"Head"
  205. flip_h = true
  206. script = ExtResource("3_b54ls")
  207. do_offset = false
  208. metadata/_custom_type_script = "uid://caq1qiwmy0mox"
  209. [node name="ResourceSetterNew" type="Node" parent="Parts/Part8" node_paths=PackedStringArray("node_to_affect")]
  210. script = ExtResource("4_bjt0v")
  211. node_to_affect = NodePath("..")
  212. property_name = "sprite_frames"
  213. resource_json = ExtResource("5_rjgwh")
  214. metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
  215. [node name="GibSpawner" type="Node" parent="Parts/Part8" node_paths=PackedStringArray("visuals")]
  216. script = ExtResource("4_30hxr")
  217. visuals = NodePath("..")
  218. play_death_sfx = false
  219. metadata/_custom_type_script = "uid://c3gg32ivrlq8n"
  220. [node name="Part9" type="AnimatedSprite2D" parent="Parts"]
  221. visible = false
  222. position = Vector2(0, -128)
  223. sprite_frames = SubResource("SpriteFrames_86hsc")
  224. animation = &"Head"
  225. flip_h = true
  226. script = ExtResource("3_b54ls")
  227. do_offset = false
  228. metadata/_custom_type_script = "uid://caq1qiwmy0mox"
  229. [node name="ResourceSetterNew" type="Node" parent="Parts/Part9" node_paths=PackedStringArray("node_to_affect")]
  230. script = ExtResource("4_bjt0v")
  231. node_to_affect = NodePath("..")
  232. property_name = "sprite_frames"
  233. resource_json = ExtResource("5_rjgwh")
  234. metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
  235. [node name="GibSpawner" type="Node" parent="Parts/Part9" node_paths=PackedStringArray("visuals")]
  236. script = ExtResource("4_30hxr")
  237. visuals = NodePath("..")
  238. play_death_sfx = false
  239. metadata/_custom_type_script = "uid://c3gg32ivrlq8n"
  240. [node name="Part10" type="AnimatedSprite2D" parent="Parts"]
  241. visible = false
  242. position = Vector2(0, -144)
  243. sprite_frames = SubResource("SpriteFrames_86hsc")
  244. animation = &"Head"
  245. flip_h = true
  246. script = ExtResource("3_b54ls")
  247. do_offset = false
  248. metadata/_custom_type_script = "uid://caq1qiwmy0mox"
  249. [node name="ResourceSetterNew" type="Node" parent="Parts/Part10" node_paths=PackedStringArray("node_to_affect")]
  250. script = ExtResource("4_bjt0v")
  251. node_to_affect = NodePath("..")
  252. property_name = "sprite_frames"
  253. resource_json = ExtResource("5_rjgwh")
  254. metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
  255. [node name="GibSpawner" type="Node" parent="Parts/Part10" node_paths=PackedStringArray("visuals")]
  256. script = ExtResource("4_30hxr")
  257. visuals = NodePath("..")
  258. play_death_sfx = false
  259. metadata/_custom_type_script = "uid://c3gg32ivrlq8n"
  260. [node name="Collision" type="CollisionShape2D" parent="."]
  261. position = Vector2(0, -8)
  262. shape = SubResource("RectangleShape2D_rjgwh")
  263. [node name="FireballDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  264. script = ExtResource("5_t1h12")
  265. hitbox = NodePath("../HeadHitbox")
  266. play_sfx_on_hit = true
  267. metadata/_custom_type_script = "uid://dri2d5jtu0fbq"
  268. [node name="FireballDetection2" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  269. script = ExtResource("5_t1h12")
  270. hitbox = NodePath("../BodyHitbox")
  271. play_sfx_on_hit = true
  272. metadata/_custom_type_script = "uid://dri2d5jtu0fbq"
  273. [node name="EnemyPlayerDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  274. script = ExtResource("6_bjt0v")
  275. hitbox = NodePath("../BodyHitbox")
  276. metadata/_custom_type_script = "uid://chj8hu207lrh"
  277. [node name="ShellDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  278. script = ExtResource("7_rjgwh")
  279. hitbox = NodePath("../BodyHitbox")
  280. metadata/_custom_type_script = "uid://bbww34oiexbx2"
  281. [node name="IcicleDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  282. script = ExtResource("8_1jb5g")
  283. hitbox = NodePath("../HeadHitbox")
  284. metadata/_custom_type_script = "uid://dq860i312isk"
  285. [node name="BlockBouncingDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  286. script = ExtResource("9_klwvr")
  287. detection_type = 1
  288. hitbox = NodePath("../BodyHitbox")
  289. metadata/_custom_type_script = "uid://cmg61722ktg2m"
  290. [node name="ExplosionDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  291. script = ExtResource("10_wuthq")
  292. hitbox = NodePath("../BodyHitbox")
  293. metadata/_custom_type_script = "uid://ba18grqjixded"
  294. [node name="BodyHitbox" type="Area2D" parent="."]
  295. position = Vector2(0, -8)
  296. scale = Vector2(0.9, 1)
  297. [node name="Collision" type="CollisionShape2D" parent="BodyHitbox"]
  298. shape = SubResource("RectangleShape2D_rjgwh")
  299. [node name="HeadHitbox" type="Area2D" parent="."]
  300. position = Vector2(0, -8)
  301. [node name="CollisionShape2D" type="CollisionShape2D" parent="HeadHitbox"]
  302. shape = SubResource("RectangleShape2D_mpg4k")
  303. [node name="VisibleOnScreenEnabler2D" type="VisibleOnScreenEnabler2D" parent="."]
  304. position = Vector2(0, -168)
  305. rect = Rect2(-10, 0, 20, 176)
  306. [node name="BasicEnemyMovement" type="Node" parent="." node_paths=PackedStringArray("visuals")]
  307. script = ExtResource("11_8aome")
  308. visuals = NodePath("../Parts")
  309. metadata/_custom_type_script = "uid://dlq6o2rg1x7in"
  310. [node name="ScoreNoteSpawner" type="Node" parent="."]
  311. script = ExtResource("12_b54ls")
  312. add_score = true
  313. metadata/_custom_type_script = "uid://5octqlf4ohel"
  314. [node name="EditorPropertyExposer" type="Node" parent="."]
  315. script = ExtResource("13_30hxr")
  316. properties = Array[String](["length"])
  317. [node name="PartHandler" type="Node" parent="."]
  318. process_mode = 3
  319. script = SubResource("GDScript_30hxr")
  320. [connection signal="killed" from="." to="." method="summon_part_gibs" unbinds=1]
  321. [connection signal="fireball_hit" from="FireballDetection" to="." method="die_from_object"]
  322. [connection signal="invincible_player_hit" from="EnemyPlayerDetection" to="." method="die_from_object"]
  323. [connection signal="player_hit" from="EnemyPlayerDetection" to="." method="damage_player"]
  324. [connection signal="player_stomped_on" from="EnemyPlayerDetection" to="." method="damage_player"]
  325. [connection signal="moving_shell_entered" from="ShellDetection" to="." method="die_from_object"]
  326. [connection signal="icicle_detected" from="IcicleDetection" to="." method="die_from_object"]
  327. [connection signal="block_bounced" from="BlockBouncingDetection" to="." method="die_from_object"]
  328. [connection signal="explosion_entered" from="ExplosionDetection" to="." method="die_from_object"]