ImpactJs を使用してレベルをロードする際に問題が発生しました。レベルにロードしようとすると、コンソールに次のエラーが表示されます。
Uncaught リソースの読み込みに失敗しました: loader.js:91 ig.Loader.ig.Class.extend._loadCallback loader.js:91 ig.Image.ig.Class.extend.onerror
レベル フォルダーに保存された map1 というレベルと、それをロードする次のコードがあります。
ig.module(
'game.main'
)
.requires(
'impact.game',
'impact.font',
'game.levels.map1'
)
.defines(function(){
MyGame = ig.Game.extend({
init: function() {
// Initialize your game here; bind keys etc.
this.loadLevel( LevelMap1 );
},
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();
}
});
// Start the Game with 60fps, a resolution of 320x240, scaled
// up by a factor of 2
ig.main( '#canvas', MyGame, 60, 960, 960, 1 );
});
誰かが私が間違っているところを見ることができますか? ありがとうございました :)