Flint Particle System Forum - particles follow mouse position 2010-06-13T12:39:40+01:00 http://flintparticles.org/forum/ Lussumo Vanilla & Feed Publisher particles follow mouse position http://flintparticles.org/forum/comments.php?DiscussionID=107&Focus=450#Comment_450 2008-10-27T12:42:40+00:00 2008-10-30T15:09:57+00:00 mp http://flintparticles.org/forum/account.php?u=83 hi! i need some help...i'm trying to put the particles, moving to the mouse position. for now i've a setTimeout function that checks every second the mouse position, and if i click in the stage, i ... i need some help...i'm trying to put the particles, moving to the mouse position.
for now i've a setTimeout function that checks every second the mouse position, and if i click in the stage, i want that particles 'fall down'.

before declaring that the particles should follow the mouse position, i had random positions and at some way the particles were moving to the indicated positions.
but now the particles aren't moving to the mouse position...After the particles collide the first time against the bounding box, they stay at that position.

here is some part of my code:

//
stage.addEventListener(MouseEvent.CLICK, stopMouse);

var myTimer:Timer = new Timer(1000);
myTimer.addEventListener('timer', moveMouse);

function moveMouse (evt:TimerEvent):void
{
emitter.addAction( new Accelerate( mouseX,mouseY));
}

function stopMouse(evt:MouseEvent):void
{
myTimer.removeEventListener('timer', moveMouse);
emitter.addAction( new Accelerate( 0,10) );
}
myTimer.start();


thanks
mp]]>
particles follow mouse position http://flintparticles.org/forum/comments.php?DiscussionID=107&Focus=455#Comment_455 2008-10-30T15:08:18+00:00 2010-06-13T12:39:40+01:00 Richard http://flintparticles.org/forum/account.php?u=1 Accelerate( mouseX, mouseY ) won't cause the particles to move towards the mouse unless they are at or near the origin. You need to accelerate them in the direction mouseX - particle.x, mouseY - ...