Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by dmen

I have different game classes that use music.add() and music.play to play background tracks. When I switch to a new level I need to clear the previously playing track. Just using add() again only adds a new track and then I have two tracks playing one after the other. I tried just doing ig.music.tracks = []; but that doesn't seem to do it.
So, how to clear the object?

1 decade ago by KenD

Turn on looping, then use ig.music.play("track name") to play the appropriate track for your level. The "ended" callback in ig.music will play the current track again if looping is enabled, otherwise it will call next() which is what you're seeing happen.

1 decade ago by dmen

Perfect! Thanks much.
Page 1 of 1
« first « previous next › last »