Flint Particle System Forum - How can I use BitmapDataZone as a container for particles?2011-12-11T11:38:32+00:00http://flintparticles.org/forum/
Lussumo Vanilla & Feed Publisher
How can I use BitmapDataZone as a container for particles?http://flintparticles.org/forum/comments.php?DiscussionID=478&Focus=1616#Comment_16162011-04-25T08:37:19+01:002011-12-11T11:38:32+00:00brian fidlerhttp://flintparticles.org/forum/account.php?u=488
I've currently got the following code:
http://pastebin.com/kUqpsfEV
However to create the "container" for my particles I'm just butted lines up against each other. I realize this isn't ...
http://pastebin.com/kUqpsfEV
However to create the "container" for my particles I'm just butted lines up against each other. I realize this isn't a very elegant solution, can I use BitmapDataZone to accomplish the same effect using the following bitmap and if so what would the code look like?
here is a link to the bitmap I am hoping to use. http://www.brianfidler.com/atmi/container-2.png
thanks brian]]>
How can I use BitmapDataZone as a container for particles?http://flintparticles.org/forum/comments.php?DiscussionID=478&Focus=1618#Comment_16182011-04-27T08:28:08+01:002011-04-27T08:28:20+01:00Richardhttp://flintparticles.org/forum/account.php?u=1
You could use a single BitmapDataZone but the collision resolution will be less accurate - particles will be retained in the zone correctly but the angle of collision with the walls will be less ...
emitter.addAction( new CollisionZone (new BitmapDataZone( bitmapData ), 100, -400 ) );
You could also use a MultiZone to combine all your line zones into a single zone.
var mz:MultiZone = new MultiZone(); mz.addZone (new LineZone( new Point( 100, -400 ), new Point( 100, -40 ) ) ); mz.addZone (new LineZone( new Point( 380, -400 ), new Point( 380, -40 ) ) ); ... emitter.addAction( new CollisionZone ( mz ) );
This won't affect the performance of your code at all, but you may prefer the concept of a single zone made from all the lines.]]>