change the ArrowBurster

19 views
Skip to first unread message

Julio Rodriguez

unread,
Jul 24, 2012, 5:27:21 PM7/24/12
to stardust-par...@googlegroups.com
Is it possible to change the *particle of an emitter ?

I start with this:
addInitializer(new DisplayObjectClass(Arrow3));

The a little later I want this (via timer):
addInitializer(new DisplayObjectClass(Arrow4));

TIA!

 julio

Allen Chou

unread,
Jul 24, 2012, 8:25:08 PM7/24/12
to stardust-par...@googlegroups.com
Yes, you can do that.
You just have to keep a reference to the DisplayObjectClass object,
and change it's displayObjectClass property later on in your program.

http://stardust-particle-engine.googlecode.com/svn/trunk/docs/idv/cjcat/stardust/twoD/initializers/DisplayObjectClass.html
--
Ming-Lun "Allen" Chou
http://allenchou.net

Julio Rodriguez

unread,
Jul 25, 2012, 1:19:33 PM7/25/12
to stardust-par...@googlegroups.com
great, thanks for the quick response!
Awesome library!!!

One more question...
How can pause & play the emitter?

Allen Chou

unread,
Jul 25, 2012, 1:44:42 PM7/25/12
to stardust-par...@googlegroups.com

Stop calling the Emitter.step method and it will be paused.

Julio Rodriguez

unread,
Jul 25, 2012, 3:01:34 PM7/25/12
to stardust-par...@googlegroups.com
thanks. I tried that. But it gives an odd behavior...

After waiting a couple of seconds, I call:
allowBurst = true
///
if (allowBurst) {
 emitter.step();
}


But when it starts, the first few particles come out weird (like not in perfect sequence with other particles).

I've managed a workaround --- wait to setup/start the particle. Instead of starting and pausing the particles.

thanks Allen!
Reply all
Reply to author
Forward
0 new messages