MontyMole.tscn 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. [gd_scene load_steps=25 format=3 uid="uid://bym2j03wxhk3t"]
  2. [ext_resource type="Script" uid="uid://dw05x347cr8jj" path="res://Scripts/Classes/Entities/Enemies/MontyMole.gd" id="1_pcto2"]
  3. [ext_resource type="Texture2D" uid="uid://c6c6uh8sicml2" path="res://Assets/Sprites/Enemies/MontyMole.png" id="2_pcto2"]
  4. [ext_resource type="Script" uid="uid://caq1qiwmy0mox" path="res://Scripts/Parts/BetterAnimatedSprite.gd" id="3_tar16"]
  5. [ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="4_p5vf8"]
  6. [ext_resource type="Texture2D" uid="uid://byy3k1pdrp77" path="res://Assets/Sprites/Particles/Smoke.png" id="4_tar16"]
  7. [ext_resource type="JSON" path="res://Assets/Sprites/Enemies/MontyMole.json" id="5_6jmde"]
  8. [ext_resource type="Script" uid="uid://chj8hu207lrh" path="res://Scripts/Classes/Components/EnemyPlayerDetection.gd" id="7_6jmde"]
  9. [ext_resource type="Script" uid="uid://bbww34oiexbx2" path="res://Scripts/Classes/Components/ShellDetection.gd" id="8_s1n1q"]
  10. [ext_resource type="Script" uid="uid://dri2d5jtu0fbq" path="res://Scripts/Classes/Components/FireballDetection.gd" id="9_006vu"]
  11. [ext_resource type="Script" uid="uid://c3gg32ivrlq8n" path="res://Scripts/Classes/Components/GibSpawner.gd" id="10_7mwc3"]
  12. [ext_resource type="Script" uid="uid://5octqlf4ohel" path="res://Scripts/Classes/Components/ScoreNoteSpawner.gd" id="11_006vu"]
  13. [ext_resource type="Script" uid="uid://cmg61722ktg2m" path="res://Scripts/Classes/Components/BlockBouncingDetection.gd" id="12_7mwc3"]
  14. [ext_resource type="Script" uid="uid://ba18grqjixded" path="res://Scripts/Classes/Components/ExplosionDetection.gd" id="13_pan54"]
  15. [sub_resource type="AtlasTexture" id="AtlasTexture_p5vf8"]
  16. atlas = ExtResource("2_pcto2")
  17. region = Rect2(0, 0, 16, 16)
  18. [sub_resource type="AtlasTexture" id="AtlasTexture_6jmde"]
  19. atlas = ExtResource("2_pcto2")
  20. region = Rect2(16, 0, 16, 16)
  21. [sub_resource type="AtlasTexture" id="AtlasTexture_jf612"]
  22. atlas = ExtResource("2_pcto2")
  23. region = Rect2(32, 0, 16, 16)
  24. [sub_resource type="SpriteFrames" id="SpriteFrames_w1rqq"]
  25. animations = [{
  26. "frames": [{
  27. "duration": 1.0,
  28. "texture": SubResource("AtlasTexture_p5vf8")
  29. }],
  30. "loop": true,
  31. "name": &"Jump",
  32. "speed": 5.0
  33. }, {
  34. "frames": [{
  35. "duration": 1.0,
  36. "texture": SubResource("AtlasTexture_6jmde")
  37. }, {
  38. "duration": 1.0,
  39. "texture": SubResource("AtlasTexture_jf612")
  40. }],
  41. "loop": true,
  42. "name": &"Walk",
  43. "speed": 10.0
  44. }]
  45. [sub_resource type="RectangleShape2D" id="RectangleShape2D_s1n1q"]
  46. size = Vector2(8, 8)
  47. [sub_resource type="RectangleShape2D" id="RectangleShape2D_mcmqd"]
  48. size = Vector2(12, 13)
  49. [sub_resource type="AtlasTexture" id="AtlasTexture_w1rqq"]
  50. atlas = ExtResource("4_tar16")
  51. region = Rect2(0, 0, 16, 16)
  52. [sub_resource type="AtlasTexture" id="AtlasTexture_s1n1q"]
  53. atlas = ExtResource("4_tar16")
  54. region = Rect2(16, 0, 16, 16)
  55. [sub_resource type="AtlasTexture" id="AtlasTexture_006vu"]
  56. atlas = ExtResource("4_tar16")
  57. region = Rect2(32, 0, 16, 16)
  58. [sub_resource type="AtlasTexture" id="AtlasTexture_7mwc3"]
  59. atlas = ExtResource("4_tar16")
  60. region = Rect2(48, 0, 16, 16)
  61. [sub_resource type="SpriteFrames" id="SpriteFrames_pan54"]
  62. animations = [{
  63. "frames": [{
  64. "duration": 1.0,
  65. "texture": SubResource("AtlasTexture_w1rqq")
  66. }, {
  67. "duration": 1.0,
  68. "texture": SubResource("AtlasTexture_s1n1q")
  69. }, {
  70. "duration": 1.0,
  71. "texture": SubResource("AtlasTexture_006vu")
  72. }, {
  73. "duration": 1.0,
  74. "texture": SubResource("AtlasTexture_7mwc3")
  75. }],
  76. "loop": true,
  77. "name": &"default",
  78. "speed": 20.0
  79. }]
  80. [node name="MontyMole" type="CharacterBody2D" node_paths=PackedStringArray("on_screen_enabler", "score_note_adder") groups=["Enemies"]]
  81. collision_layer = 16
  82. collision_mask = 54
  83. script = ExtResource("1_pcto2")
  84. on_screen_enabler = NodePath("VisibleOnScreenEnabler2D")
  85. score_note_adder = NodePath("ScoreNoteSpawner")
  86. metadata/_custom_type_script = "uid://bpydbpyjk1mt4"
  87. [node name="Sprite" type="AnimatedSprite2D" parent="."]
  88. position = Vector2(0, -8)
  89. scale = Vector2(-1, 1)
  90. sprite_frames = SubResource("SpriteFrames_w1rqq")
  91. animation = &"Walk"
  92. autoplay = "Walk"
  93. frame_progress = 0.825465
  94. offset = Vector2(0, 1)
  95. flip_h = true
  96. script = ExtResource("3_tar16")
  97. metadata/_custom_type_script = "uid://caq1qiwmy0mox"
  98. [node name="ResourceSetterNew" type="Node" parent="Sprite" node_paths=PackedStringArray("node_to_affect")]
  99. script = ExtResource("4_p5vf8")
  100. node_to_affect = NodePath("..")
  101. property_name = "sprite_frames"
  102. resource_json = ExtResource("5_6jmde")
  103. metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
  104. [node name="LCollision" type="CollisionShape2D" parent="."]
  105. position = Vector2(0, -4)
  106. rotation = -1.5708
  107. shape = SubResource("RectangleShape2D_s1n1q")
  108. one_way_collision = true
  109. [node name="RCollision" type="CollisionShape2D" parent="."]
  110. position = Vector2(0, -4)
  111. rotation = 1.5708
  112. shape = SubResource("RectangleShape2D_s1n1q")
  113. one_way_collision = true
  114. [node name="Hitbox" type="Area2D" parent="."]
  115. collision_mask = 7
  116. [node name="Shape" type="CollisionShape2D" parent="Hitbox"]
  117. position = Vector2(0, -5.5)
  118. shape = SubResource("RectangleShape2D_mcmqd")
  119. [node name="DigParticle" type="AnimatedSprite2D" parent="."]
  120. visible = false
  121. show_behind_parent = true
  122. position = Vector2(0, -16)
  123. sprite_frames = SubResource("SpriteFrames_pan54")
  124. frame_progress = 0.140432
  125. [node name="VisibleOnScreenEnabler2D" type="VisibleOnScreenEnabler2D" parent="."]
  126. position = Vector2(0, -8)
  127. [node name="EnemyPlayerDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  128. script = ExtResource("7_6jmde")
  129. hitbox = NodePath("../Hitbox")
  130. metadata/_custom_type_script = "uid://chj8hu207lrh"
  131. [node name="ShellDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  132. script = ExtResource("8_s1n1q")
  133. hitbox = NodePath("../Hitbox")
  134. metadata/_custom_type_script = "uid://bbww34oiexbx2"
  135. [node name="FireballDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  136. script = ExtResource("9_006vu")
  137. hitbox = NodePath("../Hitbox")
  138. metadata/_custom_type_script = "uid://dri2d5jtu0fbq"
  139. [node name="GibSpawner" type="Node" parent="." node_paths=PackedStringArray("visuals")]
  140. script = ExtResource("10_7mwc3")
  141. visuals = NodePath("../Sprite")
  142. metadata/_custom_type_script = "uid://c3gg32ivrlq8n"
  143. [node name="ScoreNoteSpawner" type="Node" parent="."]
  144. script = ExtResource("11_006vu")
  145. add_score = true
  146. metadata/_custom_type_script = "uid://5octqlf4ohel"
  147. [node name="BlockBouncingDetection" type="Node" parent="."]
  148. script = ExtResource("12_7mwc3")
  149. metadata/_custom_type_script = "uid://cmg61722ktg2m"
  150. [node name="ExplosionDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  151. script = ExtResource("13_pan54")
  152. hitbox = NodePath("../Hitbox")
  153. metadata/_custom_type_script = "uid://ba18grqjixded"
  154. [connection signal="killed" from="." to="GibSpawner" method="summon_gib"]
  155. [connection signal="invincible_player_hit" from="EnemyPlayerDetection" to="." method="die_from_object"]
  156. [connection signal="invincible_player_hit" from="EnemyPlayerDetection" to="ScoreNoteSpawner" method="spawn_note" binds= [200]]
  157. [connection signal="player_hit" from="EnemyPlayerDetection" to="." method="damage_player"]
  158. [connection signal="player_stomped_on" from="EnemyPlayerDetection" to="GibSpawner" method="stomp_die"]
  159. [connection signal="moving_shell_entered" from="ShellDetection" to="." method="die_from_object"]
  160. [connection signal="fireball_hit" from="FireballDetection" to="." method="die_from_object"]
  161. [connection signal="fireball_hit" from="FireballDetection" to="ScoreNoteSpawner" method="spawn_note" binds= [200]]
  162. [connection signal="block_bounced" from="BlockBouncingDetection" to="." method="die_from_object"]
  163. [connection signal="block_bounced" from="BlockBouncingDetection" to="ScoreNoteSpawner" method="spawn_note" binds= [200]]
  164. [connection signal="explosion_entered" from="ExplosionDetection" to="." method="die_from_object"]
  165. [connection signal="explosion_entered" from="ExplosionDetection" to="ScoreNoteSpawner" method="spawn_note" binds= [200]]