mikegordiyenko

Phaser.loader - active loading canceled / reset

Recommended Posts

Hi all.

I've created a game using some tutorials and examples. Suddenly I've found that used Phaser 2.0.3 instead of 2.6.2 so changed the file. And then the problem appears (in 2.0.3 everything works well). 

My game has 2 states. First is Load - where the loader image appears and then all other assets should be loaded (like in "load-events" example). Unfortunately it works not as expected. Only 2-3 files are loaded and then "Phaser.Loader - active loading canceled / reset" - this message appears in console. 

I've tried the following: removed game.load.start() from the function and checked game.load._fileList and game.load._flightQueue - they are both empty though there should be a list of files to load. Then I call the function containing the queue manually from console. After this game.load._fileList is full. Then game.load.start() also from console - and everything shows as it should be.

What's wrong with the flow in states?

Share this post


Link to post
Share on other sites

I have similar problem and sims like it's not because of code.

 

1. I have windows 10

2. I use grunt and grunt-contrib-connect - with this http server i don't have any chance to load all resources.

3. WebStorm and python simple http server has the same behaviour. At first it load several images (4 or 5), when you reload, it load another images =). and on 3d page reload it loads everything =) (and it works like this because it doesn't reload cached items).

 

So i little bit googled and found this page https://community.spiceworks.com/topic/980907-windows-10-maximum-connection-limits

It show that windows 10 has limit of 20 incoming tcp connections and maybe this is an issue, not the phaser or main code.

 

p.s. and sorry i'm newby with Phaser, just started to learn it and still at war with configs and environments =)

 

 

Ah.. and here is a code used by loader.

https://github.com/meanderingleaf/PhaserBookExamples/blob/master/shmup/src/states/Preload.js

 

 

the issue was solved in the slack channel by @phreaknation

problem in loading in create() function need to be in preload()

 

Edited by nicloay
issue solved

Share this post


Link to post
Share on other sites

It's impossible to tell what's causing your problem, but consider:

  • Call load methods only in preload, never elsewhere
  • Never call load.start() or other control methods; it runs automatically
  • Never change states except from create or update

Your best bet is to start fresh from a valid state structure (any phaser.io/examples, or Project Templates/Basic), add your code in piece by piece, and test each time.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.