Steering Behaviors
This library will bring life to the animated characters of your game by giving them autonomy. It is based on the Craig Reynold's article:
Steering Behaviors For Autonomous Characters.
Let's imagine a game where a cat pursues a mouse. You have to write the code to move the mouse, to move the cat and to take the right decisions for both: the cat wants to catch the mouse, the mouse wants to evade the cat. This library will do this very easily. You create two vehicles: a cat and a mouse, with an initial location, a maximum speed, a mass, etc. Then you add their behaviors (with the Steer function) in the main loop: Pursue for the cat, Evade for the mouse. You apply these behaviors with Cat.Move and Mouse.Move, and that's it. You're ready to watch them running around.
You have twelve behaviors available:
Align, Arrive, AvoidObstacles, Cohere, Evade, Flee, FollowPath, Pursue, Seek, Separate, View, and Wander.
And twelve examples to see them in action. By combining them, you can create new behaviors like Flock, FollowLeader, StayOnPath...
You may also use the library for your vector calculations (class SB_Vector2D).
This library is a donationware.