9 years ago by jmcnamara315
It works! works. But when I follow along in the chapter I cannot load the background. The browser moves over about 80% of the way. The browser debugger has multiple delaration dropped messages. Seems to be a mozilla bug related to fonts. Any come across this. No errors in my java console that I can see. Just moving along the Jeff Freeman book.
ig.module(
'game.main'
)
.requires(
'impact.game',
'impact.font',
'game.levels.dorm1'
)
.defines(function(){
MyGame = ig.Game.extend({
// Load a font
font: new ig.Font( '04b03.font.png' ),
init: function() {
this.loadLevel(LevelDorm1);
// Initialize your game here; bind keys etc.
},
update: function() {
// Update all entities and backgroundMaps
this.parent();
// Add your own, additional update code here
},
draw: function() {
// Draw all entities and backgroundMaps
this.parent();
// Add your own drawing code here
}
});
// Start the Game with 60fps, a resolution of 320x240, scaled
// up by a factor of 2
ig.main( '#canvas', MyGame, 60, 320, 240, 2 );
});
ig.module(
'game.main'
)
.requires(
'impact.game',
'impact.font',
'game.levels.dorm1'
)
.defines(function(){
MyGame = ig.Game.extend({
// Load a font
font: new ig.Font( '04b03.font.png' ),
init: function() {
this.loadLevel(LevelDorm1);
// Initialize your game here; bind keys etc.
},
update: function() {
// Update all entities and backgroundMaps
this.parent();
// Add your own, additional update code here
},
draw: function() {
// Draw all entities and backgroundMaps
this.parent();
// Add your own drawing code here
}
});
// Start the Game with 60fps, a resolution of 320x240, scaled
// up by a factor of 2
ig.main( '#canvas', MyGame, 60, 320, 240, 2 );
});