2023-11-19 17:08:26 +02:00
|
|
|
extends AudioStreamPlayer
|
|
|
|
|
|
|
|
var click_sound = preload("res://assets/sound/click.wav")
|
|
|
|
var spawn_sound = preload("res://assets/sound/spawn.wav")
|
2023-11-20 00:58:26 +02:00
|
|
|
var open_menu = preload("res://assets/sound/open_menu.wav")
|
|
|
|
var close_menu = preload("res://assets/sound/close_menu.wav")
|
2023-11-19 17:08:26 +02:00
|
|
|
|
|
|
|
func _ready():
|
|
|
|
volume_db = -18
|
|
|
|
|
|
|
|
func play_effect(sound):
|
|
|
|
if sound == "click":
|
|
|
|
stream = click_sound
|
2023-11-20 00:58:26 +02:00
|
|
|
volume_db = -18
|
2023-11-19 17:08:26 +02:00
|
|
|
elif sound == "spawn":
|
|
|
|
stream = spawn_sound
|
2023-11-20 00:58:26 +02:00
|
|
|
volume_db = -10
|
|
|
|
elif sound == "open_menu":
|
|
|
|
stream = open_menu
|
|
|
|
volume_db = -6
|
|
|
|
elif sound == "close_menu":
|
|
|
|
stream = close_menu
|
|
|
|
volume_db = -6
|
2023-11-19 17:08:26 +02:00
|
|
|
|
|
|
|
play()
|