Skip to content

WorldSoundSettings

data class WorldSoundSettings(
val volume: Int,
val radius: Int,
val delay: Int
) : Component()
Example
fun ringBell(sound: SoundEffectDefinition, at: Tile4) {
val bell = WorldSound.create(sound.id, at.tile, radius = 10, volume = 255, delay = 0)
World.registerWorldSound(bell, loops = 3)
Logger.info("heard within ${bell.getComponent<WorldSoundSettings>().radius} tiles")
}
val volume: Int
val radius: Int
val delay: Int