Flint Particle System Forum - Understanding how TurnTowardsPoint() is suppose to work2011-10-16T22:10:18+01:00http://flintparticles.org/forum/
Lussumo Vanilla & Feed Publisher
Understanding how TurnTowardsPoint() is suppose to workhttp://flintparticles.org/forum/comments.php?DiscussionID=512&Focus=1708#Comment_17082011-08-30T22:44:08+01:002011-10-16T22:10:18+01:00graxbishophttp://flintparticles.org/forum/account.php?u=537
Hi there,
I need some help understand how the TurnTowardsPoint() action is suppose to work.
I've tried modifying the Flocking example so that the Birds will flock towards and hover around the ...
I need some help understand how the TurnTowardsPoint() action is suppose to work.
I've tried modifying the Flocking example so that the Birds will flock towards and hover around the point of 100,100. But when I publish the code the Bird ignore the TurnTowardsPoint and move around on their own. It would appear that I don't understand how to use this action. Here's the code below.
var emitter:Emitter2D = new Emitter2D(); emitter.counter = new Blast( 20 );
emitter.addInitializer( new ImageClass( Bird ) ); emitter.addInitializer( new Position( new RectangleZone( 10, 10, 680, 480 ) ) ); emitter.addInitializer( new Velocity( new DiscZone( new Point( 0, 0 ), 150, 100 ) ) );
emitter.addAction( new ApproachNeighbours( 150, 100 ) ); emitter.addAction( new MatchVelocity( 20, 200 ) ); emitter.addAction( new MinimumDistance( 10, 600 ) ); emitter.addAction( new SpeedLimit( 100, true ) ); emitter.addAction( new RotateToDirection() ); emitter.addAction( new BoundingBox( 0, 0, 700, 500 ) ); emitter.addAction( new SpeedLimit( 200 ) ); emitter.addAction( new TurnTowardsPoint(100, 100, 5) ); emitter.addAction( new Move() );
var renderer:DisplayObjectRenderer = new DisplayObjectRenderer(); renderer.addEmitter( emitter ); addChild( renderer );
emitter.start( ); --------------
In the end I am planning to have the Points become changeable with a click of a mouse.
Any help would be greatly appreciated.]]>
Understanding how TurnTowardsPoint() is suppose to workhttp://flintparticles.org/forum/comments.php?DiscussionID=512&Focus=1729#Comment_17292011-09-27T08:43:01+01:002011-10-16T22:10:18+01:00Richardhttp://flintparticles.org/forum/account.php?u=1
You have a number of actions there that all try to alter the birds' movement so it's very likely that the TurnTowardsPoint action is being overwhelmed by the others. Try removing the Approach ...