0

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 );

});

誰かが私が間違っているところを見ることができますか? ありがとうございました :)

4

1 に答える 1

0

使用してみてください: 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 );

それ以外の場合は、画像が不足している可能性があります...

于 2014-02-02T20:28:41.657 に答える