Time for action — loading the game sound effects

  1. To load the sounds, add the LoadSound method to the game 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 the LoadSound call.
    sndEngine = eng.LoadSound("engine",True)
    
  4. Close this method.
    Return 0
    End
    

What just happened?

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.

Lay your head on me… the game layers

Layers are like sheets of paper you draw on, that are laid on top of each other.

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

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