Which particle emitter should I use?

Discussion about using Moai SDK - post questions, bugs and issues here.

Moderators: seebs, franciscotufro

Which particle emitter should I use?

Postby typeoneerror » Sat Apr 14, 2012 1:38 pm

We're looking to have our characters kick up some dust/grass/sand/snow based on the type of enivronment they are in. Looking at the samples for the particles-distanceEmitter, it looks really straightforward, but I noticed a few different Emitters in the src, namely Emitter, DistanceEmitter, and TimedEmitter. I'm wondering if anyone has any thoughts on which would be the best Emitter to use for a quick particle "kick up". Basically, if the character does a dash on grass, we want to have some grass particles kick up behind him/her quickly to give the dash a little more "oomph". Seems like TimedEmitter would be good for our "falling snow" level, but I'm not sure about these short-lived emitters. Any advice would be appreciated.
typeoneerror
 
Posts: 18
Joined: Tue Feb 14, 2012 7:30 pm

Re: Which particle emitter should I use?

Postby ibisum » Mon Apr 16, 2012 6:44 am

I would say you don't need anything more than a plain old Emitter .. but its easy enough to implement each emitter type, so why don't you just try them all and go with the 'cheapest' one that does the job without consuming too many resources (CPU/etc.)
;
--
ibisum@gmail.com
Got a MOAI snippet? Please consider adding it to http://moaisnippets.info
User avatar
ibisum
 
Posts: 1005
Joined: Mon Oct 17, 2011 1:11 am
Location: Vienna, Austria

Re: Which particle emitter should I use?

Postby derickdong » Mon Apr 16, 2012 10:08 am

I don't think its going to matter, one way or the other. The different emitters simply specify the conditions under which new particles are automatically generated. From the sounds of it, you would just use MOAIParticleEmitter's surge function to kick out the necessary particles, when the character first starts moving. However, if you want particles to be produced continuously as the character is moving, then MOAIParticleDistanceEmitter would probably be the way to go.

MOAIParticleEmitter - I'm pretty sure this is simply a base class, from which all other particle emitter's are going to derive from. Users don't seem have to access to it (I don't, anyway)
MOAIParticleDistanceEmitter - Particle(s) are emitted when the emitter has traveled the specified distance.
MOAIParticleTimedEmitter - Particle(s) are emitted at specified time intervals.
derickdong
 
Posts: 63
Joined: Wed Nov 09, 2011 2:54 pm

Re: Which particle emitter should I use?

Postby plandem » Wed Nov 14, 2012 1:38 am

sure MOAIParticleEmitter is 'abstract class', but you can use MOAIParticleSystem directly to spawn particles via pushSprite/pushParticle.
plandem
 
Posts: 37
Joined: Thu Dec 15, 2011 7:14 am


Return to Moai SDK

Who is online

Users browsing this forum: No registered users and 1 guest

x