Jump to content

Is it safeto have many states in Phaser?


caiser
 Share

Recommended Posts

It's not how I'd do it personally (I'd have a more generic Level State that loads in what it needs each time), but having said that I still can't see a problem with having 100 states. As long as you clean up on the state shutdown, so nothing lingers in memory when it shouldn't do, it should be fine. States are generally really light-weight. You could eat up more memory in a single sprite texture than in 100 states. It's just the gc to be careful of.

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...