Exemple #1
0
 /// <summary>
 /// Plans the next movement to interact with another sprite.
 /// Used only by MovementAIs.
 /// </summary>
 /// <param name="map"></param>
 /// <seealso cref="PlanMove"/>
 public void PlanAction(Map map)
 {
     if (moving != Dir.None) return;
     switch (facing) {
         case Dir.Up: map.OnAction(x, y - 1, layer); break;
         case Dir.Down: map.OnAction(x, y + 1, layer); break;
         case Dir.Left: map.OnAction(x - 1, y, layer); break;
         case Dir.Right: map.OnAction(x + 1, y, layer); break;
     }
     map.OnAction(x, y, layer);
 }