Creditos music

This commit is contained in:
2025-09-14 18:01:23 +02:00
parent e2f0105e4d
commit 9e06ff86c6
3 changed files with 56 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
# `set_volume value player`
#
# Sets the volume for the specified channel.
#
# **Parameters**
#
# - *volume*: Targeted volume
# - *player*: Sound player to use. Can either be `_sound`, which is used to play non-
# looping sound effects; `_music`, which plays looping music; or `_speech`, which
# plays non-looping voice files (default: `_sound`)
#
# @ESC
extends ESCBaseCommand
class_name SetVolumeCommand
# Return the descriptor of the arguments of this command
func configure() -> ESCCommandArgumentDescriptor:
return ESCCommandArgumentDescriptor.new(
1,
[TYPE_FLOAT,TYPE_STRING],
[null, "_music"]
)
# Validate whether the given arguments match the command descriptor
func validate(arguments: Array):
if not super.validate(arguments):
return false
if not escoria.object_manager.has(arguments[1]):
raise_error(self, "Invalid sound player. Sound player %s not registered." % arguments[1])
return false
return true
# Run the command
func run(command_params: Array) -> int:
AudioServer.set_bus_volume_db(
AudioServer.get_bus_index(escoria.BUS_MUSIC),
linear_to_db(
command_params[0]
)
)
return ESCExecution.RC_OK
# Function called when the command is interrupted.
func interrupt():
# Do nothing
pass

View File

@@ -0,0 +1 @@
uid://dqxnqfx6f0n6k

View File

@@ -21,6 +21,7 @@
say($oier_dancing, "Hmm, mejor no.", "turno_cocina_creditos_8")
say($oier_dancing, "Lanzamos los créditos?", "turno_cocina_creditos_9")
say($eneko_dancing, "Daleee!", "turno_cocina_creditos_10")
set_volume(1.0,"_music")
play_snd("res://gymkhana/sounds/intro_menu_loop.ogg", "_music")
set_global("turno_credits_rolling", true)
set_global("turno_cocina_credits_dancing", true)