• Content Count

  • Joined

  • Last visited

About iownall555

  • Rank

Profile Information

  • Gender
    Not Telling
  1. I took your advice and stated destroying everything after the state is finished through the use of the shutdown method, the game switches states perfectly fine now without any lag. Either way I'm going to set it up to change maps w/o a state restart (so there's even less of a chance of a leak). Thank you. Your answer is exactly what I needed to fix this.
  2. So I am having a bit of a performance issue with states. When restarting a state multiple times the game starts to show a noticeable slowdown which also slows down Chrome. This occurs with WebGL and Canvas. For a bit of context here, I am messing around with a tile based RPG style game and I have created a method of choosing which map to display by passing a bunch of params (such as the map, tileset, tilemap layers etc) to the state start and restart commands. I had also planned on using states for various other tasks such as a battle system. This init function for the state is here: (Though I'm not sure if it will help very much) And is usually called with something like "this.state.restart("Gameplay", null, null, "mapname", {"Tiled tileset name" : "Phaser tileset key"}, "tile layer", "collisions layer", "objects");" as an example. As I mentioned before, constant restarting causes major performance issues. So what I'm wondering is, is this an issue with how the state system works (or possibly even tilesets)? Should I find a better method of displaying maps instead of using states multiple times? Thanks.