SubatomicBroton Posted November 3, 2014 Share Posted November 3, 2014 Hello, 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 More sharing options...
stupot Posted November 3, 2014 Share Posted November 3, 2014 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: https://github.com/photonstorm/phaser/commit/0fc30e839e49d3dc8824e662390f5349116f1fa4 Link to comment Share on other sites More sharing options...
Sam Posted November 4, 2014 Share Posted November 4, 2014 Can not recreate this error if I use an particle emitter.Can you provide some code snipped? Link to comment Share on other sites More sharing options...
stupot Posted November 4, 2014 Share Posted November 4, 2014 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. Link to comment Share on other sites More sharing options...
SubatomicBroton Posted November 4, 2014 Author Share Posted November 4, 2014 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 More sharing options...
stupot Posted November 4, 2014 Share Posted November 4, 2014 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 More sharing options...
Recommended Posts