Flint Particle System Forum - particles follow mouse position2010-06-13T12:39:40+01:00http://flintparticles.org/forum/
Lussumo Vanilla & Feed Publisher
particles follow mouse positionhttp://flintparticles.org/forum/comments.php?DiscussionID=107&Focus=450#Comment_4502008-10-27T12:42:40+00:002008-10-30T15:09:57+00:00mphttp://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.
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 positionhttp://flintparticles.org/forum/comments.php?DiscussionID=107&Focus=455#Comment_4552008-10-30T15:08:18+00:002010-06-13T12:39:40+01:00Richardhttp://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 - ...