Flint Particle System Forum - Make particles decellerate and stop in a circular area Sun, 13 Jun 2010 09:02:04 +0100 http://flintparticles.org/forum/ Lussumo Vanilla 1.1.4 & Feed Publisher Make particles decellerate and stop in a circular area http://flintparticles.org/forum/comments.php?DiscussionID=131&Focus=517#Comment_517 http://flintparticles.org/forum/comments.php?DiscussionID=131&Focus=517#Comment_517 Tue, 18 Nov 2008 09:48:07 +0000 ifthenelse Unfortunately I've got a problem while making an intro for a website: it consists in some particels which start out of the stage which should converge into a cirlce area at the center of the stage.
I used a GravityWell at the center of the stage to impress the acceleration to particles, but when they reach a circle position, they start to overlap each other. Instead of this I want they to pogressively decellerate and then stop within a circular area around the center fo the stage. I don't know if I should consider another choice. Please, can anybody help me?

Heres the code:

import flash.geom.Point;
import org.flintparticles.common.counters.*;
import org.flintparticles.common.displayObjects.Dot;
import org.flintparticles.common.initializers.*;
import org.flintparticles.twoD.actions.*;
import org.flintparticles.twoD.emitters.Emitter2D;
import org.flintparticles.twoD.initializers.*;
import org.flintparticles.twoD.renderers.*;
import org.flintparticles.twoD.zones.*;

var emitter:Emitter2D = new Emitter2D();
var HCenter:Number = stage.stageWidth/2;
var VCenter:Number = stage.stageHeight/2;
var startRadiusMax:Number = stage.stageWidth+30;
var startRadiusMin:Number = stage.stageWidth+10;

emitter.counter = new Blast( 400 );
emitter.addInitializer( new ImageClass( Dot, 8 ) );
emitter.addInitializer( new ColorInit( 0xFFFFFFFF, 0xFFFFFFFF ) );
emitter.addInitializer( new CollisionRadiusInit( 7 ) );
emitter.addInitializer( new Position( new DiscZone( new Point( HCenter, VCenter ), startRadiusMax, startRadiusMin ) ) );

emitter.addAction( new Move() );
emitter.addAction( new Collide( 0.1 ) );
emitter.addAction( new GravityWell( 500, HCenter, VCenter, 1000 ) );

var renderer:DisplayObjectRenderer = new DisplayObjectRenderer();
addChild( renderer );
renderer.addEmitter( emitter );

emitter.start();
emitter.runAhead(10); ]]>
Make particles decellerate and stop in a circular area http://flintparticles.org/forum/comments.php?DiscussionID=131&Focus=519#Comment_519 http://flintparticles.org/forum/comments.php?DiscussionID=131&Focus=519#Comment_519 Tue, 18 Nov 2008 12:35:25 +0000 Richard ZonedAction, so that it only affects particles that are outside the circle. Also apply some drag so the particles slow down and stop when inside the circle. If you want to make sure the particles don't overlap, you could add a collide action so that they bounce off each other. ]]> Make particles decellerate and stop in a circular area http://flintparticles.org/forum/comments.php?DiscussionID=131&Focus=524#Comment_524 http://flintparticles.org/forum/comments.php?DiscussionID=131&Focus=524#Comment_524 Tue, 18 Nov 2008 14:07:40 +0000 ifthenelse ZonedAction and drag actions. You saved my job, now it works! ]]> Make particles decellerate and stop in a circular area http://flintparticles.org/forum/comments.php?DiscussionID=131&Focus=644#Comment_644 http://flintparticles.org/forum/comments.php?DiscussionID=131&Focus=644#Comment_644 Fri, 23 Jan 2009 03:36:35 +0000 mo can you please post your code with the ZonedAction? would be helpful for me to see how you used that, because im new with as3 and flint...
thank you so much ]]>