AudioService - SC-SGS/surviving-sarntal GitHub Wiki

Purpose

This page gives an overview of how sound is played in the game.

Audio

The audio is controlled by the AudioService, which uses Raylib to play the sound effects and the music of the game. The AudioService uses the ResourceManager to load all the sound effects and the music in memory and make available for use once the game has been started.

How to add a new sound or texture?

In order to add a new sound/texture you will need to do the following.

  1. Add the new sound as a .wav ot .mp3 file to the `assets/audio` directory
  2. Add the sound to the configuration under `sound-effects` as `sound-name: "../assets/audio/yourNewSound.wav"'
  3. After these steps you can use the new sound by calling the playSound method with the `sound-name` as parameter.
⚠️ **GitHub.com Fallback** ⚠️