Welcome, Guest
Want to take part in these discussions? Sign in if you have an account, or apply for one below
-
- CommentAuthorjevinkones
- CommentTimeJan 29th 2010
Hi everyone,
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 -
- CommentAuthorjevinkones
- CommentTimeJan 29th 2010
As for the custom particles, they would extend the Particle2D class and have added variables for text, etc.. Just thought I'd add that. :-) -
- CommentAuthorRichard
- CommentTimeFeb 9th 2010
Hi
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
1 to 3 of 3
