Пример #1
0
 public override EnemyState Update(GameTime gameTime)
 {
     if (path == null)
     {
         return(nextState());
     }
     if (nextCell == null)
     {
         nextCell = path.Dequeue();
     }
     if (nextCell == null)
     {
         return(nextState());
     }
     setCurrentCell();
     setCurrentHeading();
     setCurrentDirection();
     return(this);
 }
Пример #2
0
 private void checkNextCell()
 {
     if (nextCell == null)
     {
         if (path != null)
         {
             nextCell = path.Dequeue();
         }
         if (nextCell == null)
         {
             targetCell = null;
         }
         if (nextCell == targetCell)
         {
             targetCell = null;
             nextCell   = null;
         }
     }
 }