Les instruments font du bruit #mauvaiseIdee #stopLeSon #adieuMesOreilles

This commit is contained in:
E213872U 2025-01-25 05:09:47 +01:00
parent 204848fcf1
commit f42123d1b2
15 changed files with 157 additions and 14 deletions

View file

@ -1,6 +1,18 @@
extends Area2D
@export var speed: float = 300 # Définir la vitesse de la balle
@onready var audio = $effet
var sound_list = [
preload("res://ressources/sons/flute-1.mp3"),
preload("res://ressources/sons/flute-2.mp3"),
preload("res://ressources/sons/flute-3.mp3"),
preload("res://ressources/sons/flute-4.mp3"),
]
func _ready() :
var index = randi() % 3
audio.stream = sound_list[index]
audio.play()
# Direction initiale du mouvement
var initial_direction: Vector2 = Vector2(1, 0) # Exemple par défaut : vers la droite

View file

@ -3,6 +3,18 @@ extends Area2D
var timer = 0.0
var cooldown = 0.3
@onready var audio = $effet
var sound_list = [
preload("res://ressources/sons/lyre-1.mp3"),
preload("res://ressources/sons/lyre-2.mp3"),
preload("res://ressources/sons/lyre-3.mp3"),
]
func _ready() :
var index = randi() % 3
audio.stream = sound_list[index]
audio.play()
func _process(delta: float) -> void:
timer += delta
if timer >= cooldown:

View file

@ -1,5 +1,21 @@
extends Area2D
var audio : AudioStreamPlayer
var sound_list = [
preload("res://ressources/sons/tambour-1.mp3"),
preload("res://ressources/sons/tambour-2.mp3"),
preload("res://ressources/sons/tambour-3.mp3"),
]
func _ready() :
var index = randi_range(0, 2)
print(sound_list[index])
var audiostream = AudioStreamPlayer.new()
audiostream.stream = sound_list[index]
get_tree().current_scene.add_child(audiostream)
audiostream.play()
var timer = 0.0
var cooldown = 0.33
@ -11,4 +27,4 @@ func _process(delta: float) -> void:
func Collision(body: Node2D) -> void:
if body.is_in_group("Enemies") :
body.take_damage(2)
body.take_damage(3)