ajout intrument

This commit is contained in:
Elouan 2025-01-24 14:27:04 +01:00
parent 84f3b91978
commit 5ee577d733
11 changed files with 328 additions and 1 deletions

8
Instrument/Corde.gd Normal file
View file

@ -0,0 +1,8 @@
extends Instrument
class_name Corde
func _init(nom : String) -> void:
super(nom)
func pincer() -> void:
print("On pince l'instrument %s." % nom)

19
Instrument/Flute.gd Normal file
View file

@ -0,0 +1,19 @@
extends Vent
var Balle = preload("res://scenes/attaques/Balle.tscn").instantiate() # Charger le nœud Balle
func _init() -> void:
super("Flûte")
func jouer_melodie(player_position) -> void:
print("La flûte joue une mélodie.")
jouer()
spawn_balle(player_position)
func spawn_balle(player_position) -> void:
# Assurez-vous que vous ajoutez la balle comme enfant dans une scène appropriée
if Balle:
Balle.position = player_position # Place la balle à la position actuelle du joueur
else:
print("Erreur : la création de la balle a échoué.")

9
Instrument/Instrument.gd Normal file
View file

@ -0,0 +1,9 @@
class_name Instrument
var nom : String
func _init(nom : String) -> void:
self.nom = nom
func jouer() -> void:
print("L'instrument %s est joué." % nom)

9
Instrument/Percusson.gd Normal file
View file

@ -0,0 +1,9 @@
extends Instrument
class_name Percussion
func _init(nom : String) -> void:
super(nom)
func frapper() -> void:
print("On frappe l'instrument %s." % nom)

8
Instrument/Tambour.gd Normal file
View file

@ -0,0 +1,8 @@
extends Percussion
func _init() -> void:
super("Tambour")
func faire_roulement() -> void:
print("Le tambour fait un roulement.")
jouer()

8
Instrument/Vent.gd Normal file
View file

@ -0,0 +1,8 @@
extends Instrument
class_name Vent
func _init(nom : String) -> void:
super(nom)
func souffler() -> void:
print("On souffle dans l'instrument %s." % nom)