To load sounds, we will create a method in the game
class called LoadSounds
. There, we will load sounds for an explosion, a hit sound, and a select sound:
LoadSounds
.Method LoadSounds:Int ()
select, explosion
, and hit (remember, no file extension!).sndSelect = eng.LoadSound("select") sndExplo = eng.LoadSound("explosion") sndHit = eng.LoadSound("hit")
Return 0 End
We have created a method to load sounds into the game. To load sounds, we used fantomengine's LoadSound
method. You don't need to add the file extension to it, as fantomengine will load the one that is right for that platform. In the case of iOS, it is the MP4 file format.
3.129.216.7