Welcome, Guest
Want to take part in these discussions? Sign in if you have an account, or apply for one below
-
- CommentAuthorbrian fidler
- CommentTimeApr 25th 2011
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 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 -
- CommentAuthorRichard
- CommentTimeApr 27th 2011 edited
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 accurate. Your code would look like this -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.
1 to 2 of 2
