我在使用ImpactJ加载一个级别时遇到了问题。当我试图加载到一个级别时,控制台中会出现以下错误:
未加载资源: 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 );
});有人能看到我哪里出了问题吗?谢谢您:)
发布于 2014-02-02 20:28:41
尝试使用:https://github.com/phoboslab/impact-splash-loader/blob/master/impact-splash-loader.js
如下所示:
.requires(
'impact.game',
'impact.font',
'plugins.impact-splash-loader',
//...
});和
ig.main( '#canvas', MyGame, 60, 960, 960, 1 , ig.ImpactSplashLoader );否则,你可能会错过一幅图像.
https://stackoverflow.com/questions/20107325
复制相似问题