IrrAdventure - Part 7 - Sound creation and completions of the game

Back to the index

Sound creation

To add a sound, add between the "sounds" markers :

<sound fileName="click.wav" />
<sound fileName="wind.wav" />

and create these two sounds, or pick them from the example game, and put them in the "sound" folder, which you will create in "data". Note: you can use files with format wav, mp3 (to a certain extent), ogg, and all what is supported by audiere.

Now, add the attribute sound with value 1 to the opening markers of mechanism :

<mechanism clickX="-0.948778" clickY="-0.218659" clickZ="-0.228055" clickRadius="2" newNode="0" sound="1">

And modify the opening markers of node 0, with the attribute ambientSound to 2:

<node0 north="1" ambientSound="2">

Sound test

Launch the game. You hear the sound "wind.wav" played in loop. Click on the mechanism, you hear "click.wav".

Why did we use numbers 1 and 2 ? Because it is what allows you to identify the sounds, in the order where they were charged by the game. For better understanding, reverse the order of the "sound" markers.

Configuration of the config.xml file

Open the config.xml file. It contains some attributes which you can change the value.

And here it is all! You can now create your own adventure game !

Back to the index