Language

Sound.playMusic


Sound.playMusic(string filename)
Sound.playMusic(string filename, boolean custom = false)
Sound.playMusic(string filename, boolean custom = false, int volume = 100)

Description

Play a music. OGG is supported but MP3 is not. This function is made for playing long music. For short sounds, see Sound.play().
Here is a list of music already included in the game. Set the custom parameter to false or let the default value to use them.

Filename Description
battle.oggRetro music
BraveSoldiers.oggEpic music
DarkDescent.oggEpic music
PowerOfThyYES.oggRetro 8-bit music
SuperNinjaAssasin.oggRetro 8-bit music

Parameters

filename
The name of the music to play
custom
If the music is with the map (cmaps/mymap/music), put this to true, false otherwise.
volume
The volume of the music. Between 0 and 100.

Examples

Play a music when player start or reset the map

  1. function onReset(elapsed)
  2.     Sound.playMusic("ducktales.ogg", true)
  3. end