We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I am experimenting with flocking properties of AI for 2D Games and was wondering if the flock can be changed or affected by mouse movement or even webcam movement. If there is, what should I tweak to enable this? Thanks
Answers
Tweak the code.
Specifically, you can add additional logic to your Boid class that causes their behavior to change. Here's an example of a modified Boid class that makes the Boids flock to the mouse when you click.
I tweaked the heading and velocity of the flock by mouseX and mouseY. The effect are slow as they slowly change their course to reach the mouse pointer and they are not actually stop at it. They go through and turn around slowly to reach the mouse pointer again and continue the loop. Sometimes not so obvious the change of their navigation.
Yes. Thanks for the answer for tweaking the code :)