BobOmb.gd 546 B

1234567891011121314151617181920212223
  1. extends Enemy
  2. @export var held_scene: PackedScene = null
  3. func stomped_on(player: Player) -> void:
  4. player.enemy_bounce_off()
  5. AudioManager.play_sfx("enemy_stomp", global_position)
  6. summon_held()
  7. func summon_held() -> Node:
  8. var node = held_scene.instantiate()
  9. node.global_position = global_position
  10. node.direction = direction
  11. if $TrackJoint.is_attached:
  12. get_parent().owner.add_sibling(node)
  13. else:
  14. add_sibling(node)
  15. queue_free()
  16. return node
  17. func fireball_hit(fireball: Node2D) -> void:
  18. var held = summon_held()
  19. held.kick(fireball)