To load sounds into the game, we will create a method called LoadSounds
.
game
class, add a new method header called LoadSounds
Method LoadSounds:Int ()
"bing"
sound into the sndBing
object. Remember: don't add the file extension of your sound file to the filename. Now, close the method.sndBing = eng.LoadSound("bing") Return 0 End
With this separate method to load sounds, it will be easy for you to add other sounds as well. Just create another sound object in the data section, and then load the sound here.