Posts tagged SWF
Steering Behavior: Fleeing
Jun 12th
Time for the next steering behavior, fleeing. This will use the same Vehicle.as class and will be built off what we did in the seeking behavior. It is based on Craig Reynolds’ article, Steering Behaviors For Autonomous Characters.
Fleeing Behavior
Fleeing is very similar to seeking. It is actually the inverse of seeking. Instead of going towards the target, fleeing goes away from the target. It works like this:
1. desiredVelocity = target – position
2. desiredVelocity is normalized and multiplied by maxSpeed.
3. desiredVelocity is multiplied by -1 to go away from the target
4. steeringForce More >
Steering Behaviors: Seeking
Jun 11th
Steering behaviors are used to create intelligent movements on a computer. These posts will be an AS3 version of the principles illustrated in Craig Reynolds’ article located at http://www.red3d.com/cwr/steer/gdc99/.
Before we can start using steering behaviors, we need a few classes. First we will be using, yet again, the Vector2D.as class. Steering behaviors rely on vector math, so you should be familiar with it.
If you need more information on vector mathematics, you can look here:
https://users.cs.jmu.edu/bernstdh/web/common/lectures/slides_vector-math-2d.php
http://en.wikipedia.org/wiki/Vector_%28mathematics%29
Next we will need a vehicle class to hold all the vehicle’s properties. The properties each vehicle will More >
SAT in Action
May 22nd
In a previous post, I explained the Separation of Axis Theorem. Now it’s time to see SAT in action.
Click on a shape to move it. It both will turn red when they are touching. The shapes will turn black again when they are not colliding. Use the drop down lists to change the shapes.





