1. To load the sounds, add the
LoadSound
method to thegame
class.Method LoadSounds:Int()
2. Load the non-looping sound effects.
sndHit = eng.LoadSound("hit") sndExplo = eng.LoadSound("explosion") sndShoot = eng.LoadSound("shoot")
3. The plane engine sound needs to be looped continuously. Add a
TRUE
parameter to theLoadSound
call.sndEngine = eng.LoadSound("engine",True)
4. Close this method.
Return 0 End
You have created a method that will load all sounds we need for the game. A file extension was not given to the LoadSound
statement, as it will be added from fantomEngine, according to the platform on which you will build it. For the GLFW platform, you need WAV files.