Barrel.tscn 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. [gd_scene load_steps=18 format=3 uid="uid://byu7xm153ktle"]
  2. [ext_resource type="Script" uid="uid://dkg8usmlrm1d3" path="res://Scripts/Classes/Entities/Enemies/Barrel.gd" id="1_dkmpo"]
  3. [ext_resource type="Texture2D" uid="uid://t6lvjxubql7l" path="res://Assets/Sprites/Enemies/Barrel.png" id="2_dkmpo"]
  4. [ext_resource type="Script" uid="uid://caq1qiwmy0mox" path="res://Scripts/Parts/BetterAnimatedSprite.gd" id="3_7nplu"]
  5. [ext_resource type="Script" uid="uid://dlq6o2rg1x7in" path="res://Scripts/Classes/Components/BasicEnemyMovement.gd" id="4_8jya4"]
  6. [ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="4_m378g"]
  7. [ext_resource type="Script" uid="uid://chj8hu207lrh" path="res://Scripts/Classes/Components/EnemyPlayerDetection.gd" id="4_ynq8o"]
  8. [ext_resource type="JSON" path="res://Assets/Sprites/Enemies/Barrel.json" id="5_momh1"]
  9. [ext_resource type="Script" uid="uid://5octqlf4ohel" path="res://Scripts/Classes/Components/ScoreNoteSpawner.gd" id="8_m378g"]
  10. [ext_resource type="Script" uid="uid://ba18grqjixded" path="res://Scripts/Classes/Components/ExplosionDetection.gd" id="9_momh1"]
  11. [ext_resource type="Script" uid="uid://bbww34oiexbx2" path="res://Scripts/Classes/Components/ShellDetection.gd" id="10_fyuy0"]
  12. [ext_resource type="Script" uid="uid://cmg61722ktg2m" path="res://Scripts/Classes/Components/BlockBouncingDetection.gd" id="11_y4k56"]
  13. [ext_resource type="Script" uid="uid://dkjpfs3sm3go3" path="res://Scripts/Classes/Components/BlockHitter.gd" id="12_d7wml"]
  14. [sub_resource type="AtlasTexture" id="AtlasTexture_fyuy0"]
  15. atlas = ExtResource("2_dkmpo")
  16. region = Rect2(0, 0, 16, 16)
  17. [sub_resource type="AtlasTexture" id="AtlasTexture_y4k56"]
  18. atlas = ExtResource("2_dkmpo")
  19. region = Rect2(16, 0, 16, 16)
  20. [sub_resource type="SpriteFrames" id="SpriteFrames_d7wml"]
  21. animations = [{
  22. "frames": [{
  23. "duration": 1.0,
  24. "texture": SubResource("AtlasTexture_fyuy0")
  25. }, {
  26. "duration": 1.0,
  27. "texture": SubResource("AtlasTexture_y4k56")
  28. }],
  29. "loop": true,
  30. "name": &"default",
  31. "speed": 15.0
  32. }]
  33. [sub_resource type="RectangleShape2D" id="RectangleShape2D_7nplu"]
  34. size = Vector2(8, 8)
  35. [sub_resource type="RectangleShape2D" id="RectangleShape2D_m378g"]
  36. size = Vector2(9, 8)
  37. [node name="Barrel" type="CharacterBody2D" node_paths=PackedStringArray("on_screen_enabler", "score_note_adder") groups=["Enemies"]]
  38. collision_layer = 16
  39. collision_mask = 18
  40. floor_constant_speed = true
  41. floor_max_angle = 1.55334
  42. floor_snap_length = 4.0
  43. script = ExtResource("1_dkmpo")
  44. on_screen_enabler = NodePath("VisibleOnScreenEnabler2D")
  45. score_note_adder = NodePath("ScoreNoteSpawner")
  46. metadata/_custom_type_script = "uid://bpydbpyjk1mt4"
  47. [node name="Sprite" type="AnimatedSprite2D" parent="."]
  48. position = Vector2(0, -8)
  49. sprite_frames = SubResource("SpriteFrames_d7wml")
  50. autoplay = "default"
  51. frame_progress = 0.16310313
  52. script = ExtResource("3_7nplu")
  53. metadata/_custom_type_script = "uid://caq1qiwmy0mox"
  54. [node name="ResourceSetterNew" type="Node" parent="Sprite" node_paths=PackedStringArray("node_to_affect")]
  55. script = ExtResource("4_m378g")
  56. node_to_affect = NodePath("..")
  57. property_name = "sprite_frames"
  58. resource_json = ExtResource("5_momh1")
  59. metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
  60. [node name="VisibleOnScreenEnabler2D" type="VisibleOnScreenEnabler2D" parent="."]
  61. self_modulate = Color(1, 1, 1, 0)
  62. position = Vector2(0, -8)
  63. [node name="Collision" type="CollisionShape2D" parent="."]
  64. position = Vector2(0, -4)
  65. shape = SubResource("RectangleShape2D_7nplu")
  66. [node name="Hitbox" type="Area2D" parent="."]
  67. collision_mask = 5
  68. [node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"]
  69. position = Vector2(-0.5, -8)
  70. shape = SubResource("RectangleShape2D_m378g")
  71. [node name="EnemyPlayerDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  72. script = ExtResource("4_ynq8o")
  73. hitbox = NodePath("../Hitbox")
  74. metadata/_custom_type_script = "uid://chj8hu207lrh"
  75. [node name="BasicEnemyMovement" type="Node" parent="."]
  76. script = ExtResource("4_8jya4")
  77. metadata/_custom_type_script = "uid://dlq6o2rg1x7in"
  78. [node name="ScoreNoteSpawner" type="Node" parent="."]
  79. script = ExtResource("8_m378g")
  80. metadata/_custom_type_script = "uid://5octqlf4ohel"
  81. [node name="ExplosionDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  82. script = ExtResource("9_momh1")
  83. hitbox = NodePath("../Hitbox")
  84. metadata/_custom_type_script = "uid://ba18grqjixded"
  85. [node name="ShellDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  86. script = ExtResource("10_fyuy0")
  87. hitbox = NodePath("../Hitbox")
  88. metadata/_custom_type_script = "uid://bbww34oiexbx2"
  89. [node name="BlockBouncingDetection" type="Node" parent="."]
  90. script = ExtResource("11_y4k56")
  91. metadata/_custom_type_script = "uid://cmg61722ktg2m"
  92. [node name="BlockHitter" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  93. script = ExtResource("12_d7wml")
  94. hitbox = NodePath("../Hitbox")
  95. [connection signal="invincible_player_hit" from="EnemyPlayerDetection" to="ScoreNoteSpawner" method="spawn_note" binds= [200]]
  96. [connection signal="invincible_player_hit" from="EnemyPlayerDetection" to="." method="destroy" unbinds=1]
  97. [connection signal="player_hit" from="EnemyPlayerDetection" to="." method="damage_player"]
  98. [connection signal="player_stomped_on" from="EnemyPlayerDetection" to="." method="damage_player"]
  99. [connection signal="explosion_entered" from="ExplosionDetection" to="." method="die_from_object"]
  100. [connection signal="explosion_entered" from="ExplosionDetection" to="ScoreNoteSpawner" method="spawn_note" binds= [200]]
  101. [connection signal="moving_shell_entered" from="ShellDetection" to="." method="die_from_object"]
  102. [connection signal="block_bounced" from="BlockBouncingDetection" to="." method="bounce_up" unbinds=1]