pouvoir_javelot.gd 698 B

123456789101112131415161718192021
  1. class_name JavelotPouvoir
  2. extends PouvoirBase
  3. ## Pouvoir qui lance un puissant laser
  4. const EruptionScene: PackedScene = preload("res://effets/eruption/eruption.tscn")
  5. const JavelotScene: PackedScene = preload("res://composants/objets/javelot/javelot.tscn")
  6. func declencher_pouvoir(arbre_scene: SceneTree) -> void:
  7. print("Amorce javelot")
  8. for raquette in arbre_scene.get_nodes_in_group("groupe_des_raquettes"):
  9. var lancement: Node2D = EruptionScene.instantiate()
  10. raquette.add_child(lancement)
  11. var javelot: Javelot = JavelotScene.instantiate()
  12. javelot.position = raquette.position
  13. raquette.add_sibling.call_deferred(javelot)
  14. func couleur_principale() -> Color:
  15. return Color.ORANGE