Skip to content

Sound effects

Ian edited this page Sep 11, 2024 · 1 revision

Playing sound effects the normal way (using getAsset(...).play()) will play the sound at the same volume every time, regardless of the sound volume set by the user, specified in UserSettings.

To fix this, the ResourceService has been extended to add a new method to play a sound at the user-specified volume:

playSound(String soundName)

No sound is played when the mute setting is on.

This method allows any team who wants to play a sound effect to do so without worrying about user settings, which is currently mostly the responsibility of the menus team.

Any sounds played must be loaded first.

Table of Contents

Home

Design

Design Document

Design Choices

Game Wiki

Gameplay

Controls

Game Features

Utilities
Animals
Menus/screens
Character
Map
Weapon
Projectile
Items
Music/sound

User Guide

Starting the game

Game Engine

Getting Started

Entities and Components

Service Locator

Loading Resources

Logging

Unit Testing

Debug Terminal

Input Handling

UI

Animations

Audio

AI

Physics

Game Screens and Areas

Terrain

Concurrency & Threading

Settings

Enhancement of Settings

Troubleshooting

MacOS Setup Guide

Clone this wiki locally