O'Reilly logo

Monkey Game Development by Michael Hartlef

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action — loading the game sound effects

  1. Inside the game class, add a new method called LoadSounds.
    Method LoadSounds:Int()
    
  2. Load the select, explosion, and false sounds. Then, close the method.
    sndSelect = eng.LoadSound("select")
    sndExplo = eng.LoadSound("explosion")
    sndFalse = eng.LoadSound("false")
    Return 0
    End
    

What just happened?

You can now load all the sounds you need in one call, using this method that you just created. If you need more sounds, just add them here. Don't forget to to define a field for any additional sound in the data section.

Lay your head on me…. the game layers

The whole game user interface is set up in layers. Think about them like very thin sheets of paper that are see-through.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required