CannonBall.tscn 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. [gd_scene load_steps=9 format=3 uid="uid://bumvqjhs2xxka"]
  2. [ext_resource type="Script" uid="uid://bfdtqldkrv4dn" path="res://Scripts/Classes/Entities/Enemies/CannonBall.gd" id="1_yim3j"]
  3. [ext_resource type="Script" uid="uid://cnheej0sxmoxg" path="res://Scripts/Parts/PlayerDetection.gd" id="2_il73j"]
  4. [ext_resource type="Script" uid="uid://cbal8ms2oe1ik" path="res://Scripts/Classes/Components/ResourceSetterNew.gd" id="2_yim3j"]
  5. [ext_resource type="JSON" path="res://Assets/Sprites/Enemies/CannonBall.json" id="3_874xq"]
  6. [ext_resource type="Script" uid="uid://chj8hu207lrh" path="res://Scripts/Classes/Components/EnemyPlayerDetection.gd" id="3_pydrn"]
  7. [ext_resource type="Script" uid="uid://c3gg32ivrlq8n" path="res://Scripts/Classes/Components/GibSpawner.gd" id="4_yim3j"]
  8. [ext_resource type="Script" uid="uid://5octqlf4ohel" path="res://Scripts/Classes/Components/ScoreNoteSpawner.gd" id="5_il73j"]
  9. [sub_resource type="RectangleShape2D" id="RectangleShape2D_yim3j"]
  10. size = Vector2(8, 8)
  11. [node name="CannonBall" type="CharacterBody2D" node_paths=PackedStringArray("on_screen_enabler", "score_note_adder")]
  12. z_index = -1
  13. script = ExtResource("1_yim3j")
  14. on_screen_enabler = NodePath("VisibleOnScreenEnabler2D")
  15. score_note_adder = NodePath("ScoreNoteSpawner")
  16. metadata/_custom_type_script = "uid://bpydbpyjk1mt4"
  17. [node name="Sprite" type="Sprite2D" parent="."]
  18. [node name="ResourceSetterNew" type="Node" parent="Sprite" node_paths=PackedStringArray("node_to_affect")]
  19. script = ExtResource("2_yim3j")
  20. node_to_affect = NodePath("..")
  21. property_name = "texture"
  22. mode = 1
  23. resource_json = ExtResource("3_874xq")
  24. metadata/_custom_type_script = "uid://cbal8ms2oe1ik"
  25. [node name="PlayerDetection" type="Area2D" parent="."]
  26. script = ExtResource("2_il73j")
  27. metadata/_custom_type_script = "uid://cnheej0sxmoxg"
  28. [node name="CollisionShape2D" type="CollisionShape2D" parent="PlayerDetection"]
  29. shape = SubResource("RectangleShape2D_yim3j")
  30. [node name="EnemyPlayerDetection" type="Node" parent="." node_paths=PackedStringArray("hitbox")]
  31. script = ExtResource("3_pydrn")
  32. hitbox = NodePath("../PlayerDetection")
  33. height = 0
  34. metadata/_custom_type_script = "uid://chj8hu207lrh"
  35. [node name="GibSpawner" type="Node" parent="." node_paths=PackedStringArray("visuals")]
  36. script = ExtResource("4_yim3j")
  37. visuals = NodePath("../Sprite")
  38. metadata/_custom_type_script = "uid://c3gg32ivrlq8n"
  39. [node name="VisibleOnScreenEnabler2D" type="VisibleOnScreenEnabler2D" parent="."]
  40. [node name="ScoreNoteSpawner" type="Node" parent="."]
  41. script = ExtResource("5_il73j")
  42. metadata/_custom_type_script = "uid://5octqlf4ohel"
  43. [connection signal="invincible_player_hit" from="EnemyPlayerDetection" to="." method="die_from_object"]
  44. [connection signal="player_hit" from="EnemyPlayerDetection" to="." method="damage_player"]
  45. [connection signal="player_stomped_on" from="EnemyPlayerDetection" to="GibSpawner" method="stomp_die"]
  46. [connection signal="gib_about_to_spawn" from="GibSpawner" to="Sprite" method="set_flip_v" binds= [true]]
  47. [connection signal="screen_exited" from="VisibleOnScreenEnabler2D" to="." method="queue_free"]