1 decade ago by dahl
So no errors when i run it from localhost, but it just sits there "dead" does not seem to play at all. Anything you folks can see that i'm missing would be great, thanks!
I set 'playing' to true throughout so that it would start up, but it's just not. thanks.
ig.module (
'game.main'
)
.requires (
'impact.game',
'impact.font',
'game.entities.redskull',
'game.entities.blueskull',
'game.entities.purpleskull',
'game.entities.greenskull',
'game.entities.orangeskull',
'game.entities.yellowskull',
'game.levels.main'
)
.defines (function() {
MyGame = ig.Game.extend ( {
playing: 'true',
count: '0',
seqnum: '0',
sequence: [],
hardmode: 'false',
init: function() {
this.playing = 'true',
this.count = '0',
this.seqnum = '0',
this.sequence = [],
this.hardmode = 'false',
this.loadLevel ( LevelMain );
function spin_it(n) {
if(n==1) {
ig.game.EntityRedskull.anims.spin;
} else
if(n==2) {
ig.game.EntityYellowskull.anims.spin;
} else
if(n==3) {
ig.game.EntityBlueskull.anims.spin;
} else
if(n==4) {
ig.game.EntityOrangeskull.anims.spin;
} else
if(n==5) {
ig.game.EntityPurpleskull.anims.spin;
} else
if(n==6) {
ig.game.EntityGreenskull.anims.spin;
}
};
function rng() { //random number generator
Math.floor(Math.random()*6+1);
return;
}
function set_up() { //sets up the game
count = 0;
seqnum = 0;
playing = 'true';
// create the sequence
for(var s = 0; s<500; s++) {
sequence[s] = rng();
}
}
function begin() {
count = 0;
playing = 'true';
// AI
for(var s = 0; s<=seqnum; s++) {
setTimeout("spin_it("+ sequence[s] +")", s*interval);
}
}
},
update: function() {
// Update all entities and BackgroundMaps
this.parent();
},
draw: function() {
// Draw all entities and BackgroundMaps
this.parent();
}
});
ig.main('#canvas', MyGame, 60, 160, 240, 2);
});
I set 'playing' to true throughout so that it would start up, but it's just not. thanks.
