Flint Particle System Forum - ParticleFactory 2011-12-12T03:24:03+00:00 http://flintparticles.org/forum/ Lussumo Vanilla & Feed Publisher ParticleFactory http://flintparticles.org/forum/comments.php?DiscussionID=11&Focus=33#Comment_33 2008-03-14T16:38:07+00:00 2008-05-20T10:14:13+01:00 tlp http://flintparticles.org/forum/account.php?u=8 Hey Richard, first of all, i really like flint, thank you for your effort. I have a suggestion regarding the creation of particles. Wouldn't it be nice if you could set a Custom ParticleCreator to ... first of all, i really like flint, thank you for your effort.
I have a suggestion regarding the creation of particles.
Wouldn't it be nice if you could set a Custom ParticleCreator to the Emitter? Kind of Factory style.
I just tried it because i wanted to have particles with a target position.

let me know what you think about it.

Again big compliments

Timo]]>
ParticleFactory http://flintparticles.org/forum/comments.php?DiscussionID=11&Focus=34#Comment_34 2008-03-17T11:49:04+00:00 2011-12-12T03:24:03+00:00 Richard http://flintparticles.org/forum/account.php?u=1 Hi Timo I can think of more than one interpretation of what you're suggesting. Do you have some example code to clarify your idea? Thanks. Richard
I can think of more than one interpretation of what you're suggesting. Do you have some example code to clarify your idea? Thanks.

Richard]]>
ParticleFactory http://flintparticles.org/forum/comments.php?DiscussionID=11&Focus=35#Comment_35 2008-03-17T18:28:10+00:00 2011-12-12T03:24:03+00:00 tlp http://flintparticles.org/forum/account.php?u=8 atm flint just can create particles of the type "Particle". I wanted to create targeting Particles, so my particles needed a targetPosition property. I wrote a TargetParticleCreator which ... I wanted to create targeting Particles, so my particles needed a targetPosition property.
I wrote a TargetParticleCreator which extends ParticleCreator and i overwrote the createParticle method to create instances of TargetParticle.
But the emitter has no method to set the creator, so i had to modify it:

private static var _defaultCreator : ParticleCreator = new ParticleCreator();
private var _creator : ParticleCreator;

and

public function set creator(creator : ParticleCreator) : void {
_creator = creator;
}

public function get creator() : ParticleCreator {
return _creator ? _creator : _defaultCreator;
}

Hope you got the point. im kinda busy right now, maybe i can write some more later.

Thanx

Timo]]>
ParticleFactory http://flintparticles.org/forum/comments.php?DiscussionID=11&Focus=36#Comment_36 2008-03-18T07:08:34+00:00 2011-12-12T03:24:03+00:00 Richard http://flintparticles.org/forum/account.php?u=1 Ahh, I see what you mean. Yes, letting you change the particle creator would be a good idea. I'll also create an interface for the factory so you don't have to extend ParticleCreator, just implement ...
There is another option - the dictionary in the particle class is there so you can add additional properties to the particle. I'm not sure which is better in your instance - use the dictionary or extend particle and create a custom particle creator - I just wanted to point out the options so you can choose.]]>
ParticleFactory http://flintparticles.org/forum/comments.php?DiscussionID=11&Focus=39#Comment_39 2008-03-26T08:29:36+00:00 2011-12-12T03:24:03+00:00 tlp http://flintparticles.org/forum/account.php?u=8 Ah ok, didn't get that feature before, but it worked fine with the extended particle. beside that i slightly had to change your code ;) Thank you anyway. Thank you anyway.]]>