Jump to content

Emtter particleClass Issue


Recommended Posts



I'm trying to get an emitter working using cached bitmap data, as per this example: http://examples.phaser.io/_site/view_full.html?d=particles&f=particle%20class.js&t=particle%20class&phaser_version=v2.0.7&


The problem is, it seems to be broken as of v2.1.0. Has the method of doing this changed recently, or was a bug introduced that just escaped notice?


It's being tripped up by the AnimationManager with the following error message "Uncaught TypeError: Cannot read property 'getFrame' of null"


Thank you

Link to comment
Share on other sites

it's crashing in the AnimationManager frame setter function.  In v2.0.7, this._frameData is checked for being null before it is used with this._frameData.getFrame(value).  In v2.1.0 this check has been removed but this._frameData is null.


You'll need to look through the update history to find out and undeerstand why this was removed.  It may be an oversight or there may be a change to the api.


The breaking change occured here:



Link to comment
Share on other sites

Can not recreate this error if I use an particle emitter.

Can you provide some code snipped?


You can see the error in the example i linked; just switch the version to one higher than 2.0.7. I'd include my own snippets, but I'm not sure there's much point. I was just working off of that example to get things started and go from there.



I was pointing out why the phaser example you mentioned broke from Phaser v2.1.0 and up.  Knowing what the problem is, you'll be able to research yourself further.


Yes, thank you for looking into it. I'll dig further and see if I can identify why that change was made. At a glance, it appears it was removing unnecessary code that turned out to maybe not be so quite unnecessary after all.

Link to comment
Share on other sites

Ha, sorry Sam & Subatomic, in my last post I thought I was replying to the original poster, thought the question was a bit odd.


There appears to be similar optimisations made to the code and some attempt to make sure those checks are not needed, I'd suspect that there's a hole and the example has found it - the original modder LucBloom could maybe shed some light on it, you could ask him.

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.

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.


  • Recently Browsing   0 members

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