1 decade ago by DaveVoyles
I’m trying to load music files for my Impact game, but I can’t figure out what I’m doing wrong here. I want a different song for each screen, so I load the individual song on the screen it belongs to, then select play for that song.
Problem is, whenever a new screen loads, it just restarts the song that was already playing!
Here is my current workaround, which isn’t too elegant, and just has me calling ig.music.next(); for each screen.
Problem is, whenever a new screen loads, it just restarts the song that was already playing!
Here is my current workaround, which isn’t too elegant, and just has me calling ig.music.next(); for each screen.
.defines(function () {
StartScreen = ig.Game.extend({
stage39Music: new ig.Sound('media/Music/Stage 39.mp3, true'),
stage39Music: new ig.Sound('media/Music/Stage 39.ogg, true'),
stage39Music: new ig.Sound('media/Music/Stage 39.*, true'),
init: function () {
]
// Loads music, then begins to play track
ig.music.add(this.stage39Music);
ig.music.next();
// ig.music.play(this.stage39Music);
MyGame = ig.Game.extend({
stage50Music: new ig.Sound('media/Music/Stage 50.mp3', true),
stage50Music: new ig.Sound('media/Music/Stage 50.ogg', true),
stage50Music: new ig.Sound('media/Music/Stage 50.*', true),
/*******************************************
* Initialization
******************************************/
init: function () {
// Loads music, then begins to play track
ig.music.add(this.stage50Music);
ig.music.next();
ig.music.loop = true;
/*******************************************
* CREDITS SCREEN
*******************************************/
StaffRollScreen = ig.Game.extend({
staffRollMusic: new ig.Sound('media/Music/Staff Roll 1.mp3, Staff Roll 1', true),
staffRollMusic: new ig.Sound('media/Music/Staff Roll 1.ogg, Staff Roll 1', true),
staffRollMusic: new ig.Sound('media/Music/Staff Roll 1.*, Staff Roll 1', true),
init: function () {
// Loads music, then begins to play track
ig.music.add(this.staffRollMusic);
// ig.music.play(this.staffRollMusic);
ig.music.next();
