I would like to make my game play music tracks controlled by score. It means, the player collects point for doing something and if the number of points reaches some value, the music track should be changed immediately. Does anyone have an idea how to solve it?
Provided you're using the GiveScore() function, you can use this (add it to GlobalScript.asc):
function on_event (EventType event, int data) {
if (event == eEventGotScore) {
if (game.score >= 50 && Game.DoOnceOnly("reached 50 points")) {
// change music here
}
}
}
it works, thank you very much