Thwomp.tscn 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. [gd_scene load_steps=19 format=3 uid="uid://dq6syqkg4qjf0"]
  2. [ext_resource type="Script" uid="uid://bxfc7hxw13s6q" path="res://Scripts/Classes/Entities/Enemies/Thwomp.gd" id="1_bl7l2"]
  3. [ext_resource type="Texture2D" uid="uid://dw5k3dr3kedw3" path="res://Assets/Sprites/Enemies/Thwomp.png" id="2_kdp37"]
  4. [ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="3_bl7l2"]
  5. [ext_resource type="JSON" path="res://Assets/Sprites/Enemies/Thwomp.json" id="4_426pe"]
  6. [ext_resource type="Script" uid="uid://chj8hu207lrh" path="res://Scripts/Classes/Components/EnemyPlayerDetection.gd" id="5_gvuxk"]
  7. [ext_resource type="Script" uid="uid://cmg61722ktg2m" path="res://Scripts/Classes/Components/BlockBouncingDetection.gd" id="6_5xuvp"]
  8. [ext_resource type="Script" uid="uid://c3gg32ivrlq8n" path="res://Scripts/Classes/Components/GibSpawner.gd" id="7_01c5y"]
  9. [ext_resource type="Script" uid="uid://dri2d5jtu0fbq" path="res://Scripts/Classes/Components/FireballDetection.gd" id="8_5xuvp"]
  10. [ext_resource type="Script" uid="uid://dq860i312isk" path="res://Scripts/Classes/Components/IcicleDetection.gd" id="9_01c5y"]
  11. [ext_resource type="Script" uid="uid://d4a7yp6e55u8t" path="res://Scripts/Classes/Components/TrackJoint.gd" id="10_f8b23"]
  12. [ext_resource type="Script" uid="uid://5octqlf4ohel" path="res://Scripts/Classes/Components/ScoreNoteSpawner.gd" id="11_jkv5r"]
  13. [sub_resource type="AtlasTexture" id="AtlasTexture_bl7l2"]
  14. atlas = ExtResource("2_kdp37")
  15. region = Rect2(48, 0, 24, 32)
  16. [sub_resource type="AtlasTexture" id="AtlasTexture_426pe"]
  17. atlas = ExtResource("2_kdp37")
  18. region = Rect2(0, 0, 24, 32)
  19. [sub_resource type="AtlasTexture" id="AtlasTexture_elu2h"]
  20. atlas = ExtResource("2_kdp37")
  21. region = Rect2(24, 0, 24, 32)
  22. [sub_resource type="SpriteFrames" id="SpriteFrames_gvuxk"]
  23. animations = [{
  24. "frames": [{
  25. "duration": 1.0,
  26. "texture": SubResource("AtlasTexture_bl7l2")
  27. }],
  28. "loop": true,
  29. "name": &"Fall",
  30. "speed": 5.0
  31. }, {
  32. "frames": [{
  33. "duration": 1.0,
  34. "texture": SubResource("AtlasTexture_426pe")
  35. }],
  36. "loop": true,
  37. "name": &"Idle",
  38. "speed": 5.0
  39. }, {
  40. "frames": [{
  41. "duration": 1.0,
  42. "texture": SubResource("AtlasTexture_elu2h")
  43. }],
  44. "loop": true,
  45. "name": &"Look",
  46. "speed": 5.0
  47. }]
  48. [sub_resource type="RectangleShape2D" id="RectangleShape2D_5xuvp"]
  49. size = Vector2(24, 31)
  50. [sub_resource type="RectangleShape2D" id="RectangleShape2D_f8b23"]
  51. size = Vector2(20, 30)
  52. [sub_resource type="RectangleShape2D" id="RectangleShape2D_gvuxk"]
  53. size = Vector2(16, 1)
  54. [node name="Thwomp" type="CharacterBody2D" node_paths=PackedStringArray("on_screen_enabler", "score_note_adder") groups=["Enemies"]]
  55. collision_layer = 16
  56. collision_mask = 6
  57. script = ExtResource("1_bl7l2")
  58. on_screen_enabler = NodePath("VisibleOnScreenEnabler2D")
  59. score_note_adder = NodePath("ScoreNoteSpawner")
  60. metadata/_custom_type_script = "uid://bpydbpyjk1mt4"
  61. [node name="Sprite" type="AnimatedSprite2D" parent="."]
  62. unique_name_in_owner = true
  63. position = Vector2(0, -16)
  64. sprite_frames = SubResource("SpriteFrames_gvuxk")
  65. animation = &"Idle"
  66. autoplay = "Idle"
  67. offset = Vector2(0, 1)
  68. [node name="ResourceSetterNew" type="Node" parent="Sprite" node_paths=PackedStringArray("node_to_affect")]
  69. script = ExtResource("3_bl7l2")
  70. node_to_affect = NodePath("..")
  71. property_name = "sprite_frames"
  72. resource_json = ExtResource("4_426pe")
  73. metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
  74. [node name="Collision" type="CollisionShape2D" parent="."]
  75. position = Vector2(0, -15.5)
  76. shape = SubResource("RectangleShape2D_5xuvp")
  77. one_way_collision = true
  78. [node name="VisibleOnScreenEnabler2D" type="VisibleOnScreenEnabler2D" parent="."]
  79. position = Vector2(0, -16)
  80. rect = Rect2(-16, -24, 32, 512)
  81. [node name="Hitbox" type="Area2D" parent="."]
  82. [node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"]
  83. position = Vector2(0, -16)
  84. shape = SubResource("RectangleShape2D_f8b23")
  85. [node name="EnemyPlayerDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  86. script = ExtResource("5_gvuxk")
  87. hitbox = NodePath("../Hitbox")
  88. metadata/_custom_type_script = "uid://chj8hu207lrh"
  89. [node name="BlockBouncingDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  90. script = ExtResource("6_5xuvp")
  91. detection_type = 1
  92. hitbox = NodePath("../Hitbox")
  93. metadata/_custom_type_script = "uid://cmg61722ktg2m"
  94. [node name="GibSpawner" type="Node" parent="." node_paths=PackedStringArray("visuals")]
  95. script = ExtResource("7_01c5y")
  96. visuals = NodePath("../Sprite")
  97. metadata/_custom_type_script = "uid://c3gg32ivrlq8n"
  98. [node name="BlockBreakingHitbox" type="Area2D" parent="."]
  99. unique_name_in_owner = true
  100. collision_layer = 0
  101. collision_mask = 6
  102. [node name="CollisionShape2D" type="CollisionShape2D" parent="BlockBreakingHitbox"]
  103. position = Vector2(0, 0.5)
  104. shape = SubResource("RectangleShape2D_gvuxk")
  105. [node name="FireballDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  106. script = ExtResource("8_5xuvp")
  107. hitbox = NodePath("../Hitbox")
  108. play_sfx_on_hit = true
  109. metadata/_custom_type_script = "uid://dri2d5jtu0fbq"
  110. [node name="IcicleDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  111. script = ExtResource("9_01c5y")
  112. hitbox = NodePath("../Hitbox")
  113. metadata/_custom_type_script = "uid://dq860i312isk"
  114. [node name="TrackJoint" type="Node" parent="."]
  115. script = ExtResource("10_f8b23")
  116. disable_physics = false
  117. metadata/_custom_type_script = "uid://d4a7yp6e55u8t"
  118. [node name="ScoreNoteSpawner" type="Node" parent="."]
  119. script = ExtResource("11_jkv5r")
  120. metadata/_custom_type_script = "uid://5octqlf4ohel"
  121. [connection signal="killed" from="." to="GibSpawner" method="summon_gib"]
  122. [connection signal="invincible_player_hit" from="EnemyPlayerDetection" to="." method="die_from_object"]
  123. [connection signal="player_hit" from="EnemyPlayerDetection" to="." method="damage_player"]
  124. [connection signal="player_stomped_on" from="EnemyPlayerDetection" to="." method="damage_player"]
  125. [connection signal="block_bounced" from="BlockBouncingDetection" to="." method="die_from_object"]