PDA

View Full Version : How to go about Attracters


firdosh
12-10-2006, 09:49 PM
I am trying to get this effect in AS3

http://www.complexification.net/gallery/machines/peterdejong/

I was wondering what would be the best way to go about.
I was thinking a single Sprite where i would call the particles draw method using the onEnterFrame event but going through a 4000 loop evertime inside the onEnterFrameEvent seems to be a bit too intensive, even for a Timer event


anyone have any ideas ??

also would this be the best way to draw a pixel drawRect(x,y,1,1) ??

thanks
firdosh

Tink
12-10-2006, 11:50 PM
best way to draw a single pixel would be BitmapData.setPixel( x, y, color );

you might get away with 4000 loops each frame. it would depend on the algorithm your using to sepcify the positions i guess. you'd be best to do some tests.

firdosh
12-11-2006, 07:30 PM
thanks tink,
gonna try do some tests now :)