Jump to content

bdickason

Members
  • Content Count

    3
  • Joined

  • Last visited

  1. That was it!! I didn't realize that my old sprites from the first state stuck around in memory in the second state! I checked the 'id' field (unique identifier i assign to each sprite) and it was one from the first state o_O Thanks so much If anyone stumbles upon this in the future, the old sprites were sticking around and had an event that listened any time data was loaded for that class: window.socket.on(`data:load:${name}` My next state instantiated a new instance of the same sprite so when it spawned, the old sprite was destroyed but was still listening to this event.
  2. Hmm that's an interesting idea. I had thought about the sprite not being loaded in time (i.e. I was calling animation.start before it's fully setup) but not that it was already destroyed. Will play around with that tonight, thanks!!!
  3. I've been battling this problem for the past 24h and figured it was worth asking for help. I've got a class called Character that extends Phaser.Sprite and is used in a few States (Character Select->Play) for my game. When I instantiate new Characters in the Select class or Play class, they work great as expected. However, when I load the Select state and select a character (which calls the 'Play' state), the Character class errors upon instantiating a new character in the new state with the following message: Uncaught TypeError: Cannot read property 'getFrameIndexes' of null
×
×
  • Create New...