gabenix Posted May 29, 2014 Share Posted May 29, 2014 Hi All, I've just started using Phaser over the last couple of days and am liking it very much. I've never attempted any serious programming with Javascript, but seem to be catching on quickly thanks to all the available Phaser documentation. My question concerns the performance hit of using "emitters" in place of "groups". I understand that the emitter functions are basically an extension to the groups functions. What I'm doing is creating an endless scroller/runner game format. As the screen scrolls, pre-composed "scene" sections are chosen randomly, then generated off screen and scroll by from right to left. These scenes are composed of platforms, coins, enemies, and various objects. I've been using an emitter for each type of scene object (i.e coin emitter, enemy emitter, platform emitter, etc). Each emitter will generate a scene that will then scroll by, after a certain time has elapsed, another scene will be chosen at random, then generated and allowed to scroll by. I've been using emitters instead of simple groups because it requires less coding on my part to generate each scene. This has been working just fine with no lag or noticable hit in performance so far. My concern is that as the game gets more complicated with more scene objects, will I eventually start to see a hit in performance? The reason I feel this way is that it seems that emitter particles get several physics properties automatically applied to them, some of which i'm not using. Will using emitters instead of groups for this eventually create a performance disadvantage? What would you use to continually generate scrolling scene content? Link to comment Share on other sites More sharing options...
BenClarkson Posted May 29, 2014 Share Posted May 29, 2014 I think if you build in a kill for the objects crossing the world bound you should be fine to make sure you have some nice garbage collection. If you run into performance issues consider using inheritance to optimize what objects have what physics applied to them.Looking forward to seeing your game! Link to comment Share on other sites More sharing options...
gabenix Posted May 30, 2014 Author Share Posted May 30, 2014 Thanks for the reply Ben! I suppose converting to and from emitters and groups isn't that difficult and I can test it both ways. The issue I'm trying to overcome now is access to individual particle parameters. I've started a new thread on that subject... Link to comment Share on other sites More sharing options...
Recommended Posts