Jump to content

DOM frozen when resetting state


ForgeableSum
 Share

Recommended Posts

Not sure how you're managing to 'freeze' the DOM, if you're performing heavy synchronous calculations during a load/reset then this will occupy the JS thread, meaning that any JS animations will cease and responding to any actions will become impossible (to solve that you'd need a scheduler, not an easy task!). If you're just loading assets then these won't block, JS is event driven so it initiates a network event to load stuff and responds to an event when it finishes.

Conceptually you just need to attach listeners to your load events i.e. you load all the assets for Player A and listen for the finished event and then you could create an image element on the page (or a sprite in a canvas) with an image you've just loaded. Pretty sure Phaser makes this trivial by exposing load events.

Link to comment
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...
 Share

  • Recently Browsing   0 members

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