Muncher.tscn 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. [gd_scene load_steps=15 format=3 uid="uid://bi1hb03wk001p"]
  2. [ext_resource type="Script" uid="uid://bpydbpyjk1mt4" path="res://Scripts/Classes/Entities/Enemy.gd" id="1_cgdwi"]
  3. [ext_resource type="Texture2D" uid="uid://dg7yxoq44gaae" path="res://Assets/Sprites/Enemies/Muncher.png" id="2_ad4wf"]
  4. [ext_resource type="Script" uid="uid://caq1qiwmy0mox" path="res://Scripts/Parts/BetterAnimatedSprite.gd" id="2_fcan1"]
  5. [ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="4_6tj01"]
  6. [ext_resource type="Script" uid="uid://cnheej0sxmoxg" path="res://Scripts/Parts/PlayerDetection.gd" id="4_ad4wf"]
  7. [ext_resource type="JSON" path="res://Assets/Sprites/Enemies/Muncher.json" id="5_cgdwi"]
  8. [ext_resource type="Script" uid="uid://5octqlf4ohel" path="res://Scripts/Classes/Components/ScoreNoteSpawner.gd" id="5_r7ue2"]
  9. [ext_resource type="Script" uid="uid://bx6r8sjar6cwr" path="res://Scripts/Classes/Components/BasicStaticMovement.gd" id="8_3kryf"]
  10. [sub_resource type="AtlasTexture" id="AtlasTexture_r7ue2"]
  11. atlas = ExtResource("2_ad4wf")
  12. region = Rect2(0, 0, 16, 16)
  13. [sub_resource type="AtlasTexture" id="AtlasTexture_60xif"]
  14. atlas = ExtResource("2_ad4wf")
  15. region = Rect2(16, 0, 16, 16)
  16. [sub_resource type="SpriteFrames" id="SpriteFrames_6tj01"]
  17. animations = [{
  18. "frames": [{
  19. "duration": 1.0,
  20. "texture": SubResource("AtlasTexture_r7ue2")
  21. }, {
  22. "duration": 1.0,
  23. "texture": SubResource("AtlasTexture_60xif")
  24. }],
  25. "loop": true,
  26. "name": &"default",
  27. "speed": 5.0
  28. }]
  29. [sub_resource type="RectangleShape2D" id="RectangleShape2D_cgdwi"]
  30. size = Vector2(15.9, 16)
  31. [sub_resource type="RectangleShape2D" id="RectangleShape2D_r7ue2"]
  32. size = Vector2(17, 18.5)
  33. [sub_resource type="RectangleShape2D" id="RectangleShape2D_3kryf"]
  34. size = Vector2(16, 16)
  35. [node name="Muncher" type="CharacterBody2D" node_paths=PackedStringArray("on_screen_enabler", "score_note_adder") groups=["Enemies"]]
  36. disable_mode = 1
  37. collision_layer = 20
  38. collision_mask = 4114
  39. script = ExtResource("1_cgdwi")
  40. on_screen_enabler = NodePath("VisibleOnScreenEnabler2D")
  41. score_note_adder = NodePath("ScoreNoteSpawner")
  42. metadata/_custom_type_script = "uid://bpydbpyjk1mt4"
  43. metadata/block_spawn_offset = Vector2(0, -8)
  44. [node name="Sprite" type="AnimatedSprite2D" parent="."]
  45. sprite_frames = SubResource("SpriteFrames_6tj01")
  46. frame_progress = 0.602985
  47. script = ExtResource("2_fcan1")
  48. do_offset = false
  49. metadata/_custom_type_script = "uid://caq1qiwmy0mox"
  50. [node name="ResourceSetterNew" type="Node" parent="Sprite" node_paths=PackedStringArray("node_to_affect")]
  51. script = ExtResource("4_6tj01")
  52. node_to_affect = NodePath("..")
  53. property_name = "sprite_frames"
  54. resource_json = ExtResource("5_cgdwi")
  55. metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
  56. [node name="Collision" type="CollisionShape2D" parent="."]
  57. shape = SubResource("RectangleShape2D_cgdwi")
  58. one_way_collision = true
  59. [node name="PlayerDetection" type="Area2D" parent="."]
  60. script = ExtResource("4_ad4wf")
  61. metadata/_custom_type_script = "uid://cnheej0sxmoxg"
  62. [node name="CollisionShape2D" type="CollisionShape2D" parent="PlayerDetection"]
  63. position = Vector2(0, -0.75)
  64. shape = SubResource("RectangleShape2D_r7ue2")
  65. [node name="VisibleOnScreenEnabler2D" type="VisibleOnScreenEnabler2D" parent="."]
  66. [node name="ScoreNoteSpawner" type="Node" parent="."]
  67. script = ExtResource("5_r7ue2")
  68. metadata/_custom_type_script = "uid://5octqlf4ohel"
  69. [node name="Movement" type="Node" parent="."]
  70. script = ExtResource("8_3kryf")
  71. [node name="AnimatableBody2D" type="AnimatableBody2D" parent="."]
  72. collision_layer = 33
  73. collision_mask = 0
  74. sync_to_physics = false
  75. [node name="CollisionShape2D" type="CollisionShape2D" parent="AnimatableBody2D"]
  76. shape = SubResource("RectangleShape2D_3kryf")
  77. [connection signal="player_entered" from="PlayerDetection" to="." method="damage_player"]