Jump to content

(Self-created) Loader failed in IE11


datvm
 Share

Recommended Posts

Hello,

 

I have a Splash Screen that show my game's logo and loading banner (two simple Images). In the create() method, I create a loader myself and load other resources.

 

However, IE11 could not load the resources (Chrome works fine, I haven't tested Firefox yet), and the onLoadComplete event is not fired. There are multiple warning message in IE's Console:

Phaser.Loader - active loading canceled / reset

(usually 5 time)

 

Below are the code and screenshot:

/// <reference path="/src/init.js" />/// <reference path="/lib/phaser/phaser.js" />MusicArena.SplashScreen = function () {    Phaser.State.call(this);    this.loadFinished = false;    this.counter = SPLASH_TIME;};MusicArena.SplashScreen.constructor = MusicArena.SplashScreen;MusicArena.SplashScreen.prototype = Object.create(Phaser.State.prototype);MusicArena.SplashScreen.prototype.preload = function () {    this.game.load.image("splash", "/asset/splash.png");    this.game.load.image("loading", "/asset/loadingbanner.png");};MusicArena.SplashScreen.prototype.loadResouces = function () {    var loader = new Phaser.Loader(this.game);    loader.onLoadComplete.add(this.onLoadComplete, this);    loader.image("crown", "/asset/crown.png");    loader.spritesheet("btnOption", "/asset/buttons/option.png", 460, 130);    loader.image("inthebag", "/asset/inthebag.png");    loader.spritesheet("btnPredict", "/asset/buttons/predict.png", 100, 100);    loader.image("host", "/asset/host.png");    loader.image("users", "/asset/users.png");    loader.image("bet", "/asset/coin.png");    loader.spritesheet("btnBack", "/asset/buttons/back.png", 50, 50);    loader.image("charm", "/asset/charm.png");    loader.image("hint", "/asset/hint.png");    loader.spritesheet("btnClose", "/asset/buttons/close.png", 480, 80);    loader.spritesheet("ranks", "/asset/ranks.png", 64, 64);    loader.spritesheet("predictionResult", "/asset/result.png", 64, 64);    loader.image("cup", "/asset/cup.png");    loader.spritesheet("ranks", "/asset/ranks.png", 64, 64);    loader.spritesheet("btnLeaderboardDaily", "/asset/buttons/leaderboard_daily.png", 120, 40);    loader.spritesheet("btnLeaderboardWeekly", "/asset/buttons/leaderboard_weekly.png", 120, 40);    loader.spritesheet("btnLeaderboardMonthly", "/asset/buttons/leaderboard_monthly.png", 120, 40);    loader.spritesheet("btnLeaderboardAll", "/asset/buttons/leaderboard_all.png", 120, 40);    loader.spritesheet("btnLeaderboardTop", "/asset/buttons/leaderboard_top.png", 120, 40);    loader.spritesheet("btnLeaderboardPersonal", "/asset/buttons/leaderboard_personal.png", 120, 40);    loader.spritesheet("btnCreateRoom", "/asset/buttons/createroom.png", 240, 50);    loader.spritesheet("btnJoinRandom", "/asset/buttons/joinrandom.png", 240, 50);    loader.spritesheet("btnShop", "/asset/buttons/shop.png", 300, 70);    loader.spritesheet("btnSearch", "/asset/buttons/search.png", 50, 50);    loader.spritesheet("btnChangeAvatar", "/asset/buttons/changeavatar.png", 150, 50);    loader.spritesheet("btnLeaderboard", "/asset/buttons/leaderboard.png", 150, 50);    loader.spritesheet("btnStartGame", "/asset/buttons/startgame.png", 480, 60);    loader.image("money", "/asset/money.png");    loader.image("btnEquipped", "/asset/buttons/equipped.png");    loader.spritesheet("btnEquip", "/asset/buttons/equip.png", 120, 50);    loader.spritesheet("btnPurchase", "/asset/buttons/purchase.png", 120, 50);    loader.spritesheet("btnOptionFillIn", "/asset/buttons/option_fillin.png", 225, 120);    loader.audio("sndPredictionCorrect", "/asset/sfx/ambience_prediction_correct.mp3");    loader.audio("sndSelection", "/asset/sfx/Selection.mp3");    loader.audio("sndResult", "/asset/sfx/This is our land.mp3");    loader.audio("sndBuy", "/asset/sfx/buy.mp3");    loader.audio("sndCorrect", "/asset/sfx/correct.mp3");    loader.audio("sndCrowd0", "/asset/sfx/crowd0.mp3");    loader.audio("sndCrowd1", "/asset/sfx/crowd1.mp3");    loader.audio("sndCrowd2", "/asset/sfx/crowd2.mp3");    loader.audio("sndCrowd3", "/asset/sfx/crowd3.mp3");    loader.audio("sndJoin", "/asset/sfx/join.mp3");    loader.audio("sndPick", "/asset/sfx/pick.mp3");    loader.audio("sndSlide", "/asset/sfx/slide.mp3");    loader.audio("sndWrong", "/asset/sfx/wrong.mp3");    loader.audio("sndCorrect", "/asset/sfx/correct.mp3");    loader.audio("sndEquip", "/asset/sfx/equip.mp3");    loader.audio("sndStartGame", "/asset/sfx/startgame.mp3");    loader.start();}MusicArena.SplashScreen.prototype.onLoadComplete = function () {    this.loadFinished = true;    this.add.tween(this.lblBanner).to({ alpha: 0 }, 500, Phaser.Easing.Linear.None, true);};MusicArena.SplashScreen.prototype.create = function () {    this.sprSplash = this.add.sprite(CAM_WIDTH / 2, CAM_HEIGHT / 2, "splash");    this.sprSplash.anchor.set(0.5, 0.5);    this.sprSplash.scale.set(CAM_WIDTH * .75 / this.sprSplash.width);    var lblBanner = new Phaser.Image(this.game, CAM_WIDTH - 5, CAM_HEIGHT - 5, "loading");    lblBanner.anchor.setTo(1, 1);    this.add.existing(lblBanner);    this.lblBanner = lblBanner;    this.loadResouces();    this.game.ambienceManager = new MusicArena.AmbienceManager(this.game);    this.game.ambienceManager.playMenu();};MusicArena.SplashScreen.prototype.update = function () {    deltaTime = game.time.elapsedMS / 1000;    this.counter -= deltaTime;    if (this.counter <= 0 && this.loadFinished) {        var portalScreen = new MusicArena.PortalScreen();        MusicArena.game.state.add("portal", portalScreen);        MusicArena.game.state.start("portal");    };}MusicArena.SplashScreen.prototype.shutdown = function () {}

post-14453-0-85170600-1440363118_thumb.p

 

Is there anything I do wrong?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...