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);
 }
Exemplo n.º 3
0
 /* AI that sets the actor to move and shoot
  */
 public void InitializeAIStartStop()
 {
     //first, the two basic states: move or stop
     AIState move = new AIState(true, false);
     AIState stop = new AIState(false, false);
     //now, we connect them with the appropriate triggers
     var t1 = new TriggerTime(stop, 0.25f);
     var t2 = new TriggerTime(move, 0.25f);
     move.AddTrigger(t1);
     stop.AddTrigger(t2);
     AIStartStop = new AI(move);
 }