Flint Particle System Forum - create custom particles and push to particle array? Tue, 13 Dec 2011 14:56:42 +0000 http://flintparticles.org/forum/ Lussumo Vanilla 1.1.10 & Feed Publisher create custom particles and push to particle array? http://flintparticles.org/forum/comments.php?DiscussionID=312&Focus=1081#Comment_1081 http://flintparticles.org/forum/comments.php?DiscussionID=312&Focus=1081#Comment_1081 Fri, 29 Jan 2010 23:09:31 +0000 jevinkones
I've been using FLiNT for quite some time and I'm really loving it. Long live Richard Lord!!!

However, my curiosities have gotten the best of me and I've been trying for DAYS to figure out if it's possible to create an array of custom particles (i.e.: using a for loop) and use that for the emitter?

What would be most ideal in my situation would be to have a large array of custom particles (or objects that store information for the custom particles) that I could have use as a "pool" of particles to emit from, having only 4-5 particles in the emitter at a time. The particles would have a lifespan that once it has expired they get discarded and the next set of 5 from the array would be loaded into the emitter.

Accomplishing this without the aide of people much smarter than me is beyond my abilities. Any and all help is greatly appreciated.

Thanks in advance,
Kevin ]]>
create custom particles and push to particle array? http://flintparticles.org/forum/comments.php?DiscussionID=312&Focus=1082#Comment_1082 http://flintparticles.org/forum/comments.php?DiscussionID=312&Focus=1082#Comment_1082 Fri, 29 Jan 2010 23:13:19 +0000 jevinkones create custom particles and push to particle array? http://flintparticles.org/forum/comments.php?DiscussionID=312&Focus=1099#Comment_1099 http://flintparticles.org/forum/comments.php?DiscussionID=312&Focus=1099#Comment_1099 Tue, 09 Feb 2010 14:05:48 +0000 Richard
A few points to consider -

1. You can add custom properties to Flint's standard particles. The particle object contains a dictionary which can be used to store additional properties that you want to assign to the particles.

2. The Emitter has a particleFactory property, which is a factory class that creates particles. The Emitter2D class uses a default ParticleFactory called ParticleCreator2D<\a>. You can create your own class, implementing the ParticleFactory interface, and assign it to the particleFactory property of the Emitter. Then the Emitter will use your class to get new particles, and your class can create the custom particle type that you want.

3. You may create particles and add them directly to the Emitter by using the Emitter's addExistingParticles method.

Richard ]]>