In a more practical use:
Code:
void OnGameTick()
{
...
if (player[0].x == 25 && (player[0].y == 25) //once the player crosses [25,25]...
{
if (music.filename != "cooba.mp3")
music.filename = "cooba.mp3"; //...the music will change...
music.play("cooba.mp3"); //...and begin playing
}
...
}
|