Time for action — loading the game sound effects

To load sounds into the game, we will create a method called LoadSounds.

  1. Inside the game class, add a new method header called LoadSounds
    Method LoadSounds:Int ()
    
  2. Load the"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
    

What just happened?

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.

Game layers

Layers are like groups. They are rendered in their order of creation, unless you tell the engine to do it otherwise.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset