ns_error_not_available when put on the web server

1

I did a mini game on localhost and everything was working perfectly .. Then I uploaded it to the web server and the game started to crash with the error "NS_ERROR_NOT_AVAILABLE:".

...
var spriteSheet = new Image();
var player = new Sprite(spriteSheet);sprites.push(player);
...
for (var i in sprites) {
    var spr = sprites[i];
    if (spr.visible) {
        spr.draw(ctx); // erro aqui
    }
}
...

(in another .js file)

...
this.draw = function(ctx){
    ctx.drawImage(this.img, this.srcX, this.srcY, this.width, this.height,this.posX,this.posY, this.width, this.height); // erro aqui
        this.animation();
    } 
...

I've been looking into this and I think you need to create a function to load the images before starting the game itself.

    
asked by anonymous 05.11.2017 / 19:09

0 answers