Exemplo n.º 1
0
 public void InitializeAIHoming()
 {
     AIState move = new AIState(true, false);
     AIState home = new AIState(true, true);
     CollisionCounter c = new CollisionCounter(40, 3, Device);
     var t1 = new TriggerCollision(home, c, 0, false);
     move.AddTrigger(t1);
     AIHoming = new AI(move);
 }
Exemplo n.º 2
0
 /* AI For enemy actors. When a friendly (player)
  * actor comes close, the actor will stop moving.
  */
 public void InitializeAICloseStop()
 {
     AIState move = new AIState(true, false);
     AIState stop = new AIState(false, false);
     CollisionCounter c = new CollisionCounter(30, 3, Device);//radius of 15, collides with Friendly Actors
     var t1 = new TriggerCollision(stop, c, 0, false); // trips when more than 1 friendly actor in radius
     var t2 = new TriggerCollision(move, c, 1, true); // trips when there are no friendly actors in radius
     move.AddTrigger(t1);
     stop.AddTrigger(t2);
     AICloseStop = new AI(move);
 }