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,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)