Publishers of technology books, eBooks, and videos for creative people

Home > Articles > Web Design & Development > PHP/MySQL/Scripting

  • Print
  • + Share This


Once we know how to chase targets around, it is easy to learn to evade. Essentially, evading is the opposite of chasing. Instead of trying to decrease the distance to the target, we will try to maximize it. Thus, an evasion algorithm will be very similar to a chasing algorithm except for some sign changes. Here it is in detail:

void evade(point mypos, float myyaw, point hispos) 
reaim(mypos,myyaw,hispos); negated 

mypos.x = mypos.x + cos(myyaw) * speed; 
mypos.z = mypos.z + sin(myyaw) * speed; } 
  • + Share This
  • 🔖 Save To Your Account

Related Resources

There are currently no related titles. Please check back later.