示例#1
0
void AIRobot::Update(float elapsedTime) 
{
	// Step 1 : check for enemy
	// TODO : Finish this part and decide what to do
	CheckForEnemy();

	// Step 2 : check if we reached target
	if (isCloseEnough())
	{
		mGridPos = mGridTarget;
		FindNewTarget();
	}
	
	// Step 3 : move towards target
	MoveToTarget(elapsedTime);

}
示例#2
0
inline bool IsCloseEnough(double A, double B, double Epsilon)
{
  return isCloseEnough(A,B,Epsilon);
}