Exemple #1
0
 public void UpdateDestroyer(Destroyer destroyer, int elapsedTime)
 {
     if (destroyer != null)
     {
         destroyer.Update(elapsedTime);
         var cell = PositionConverter.GetCellByTilePosition(destroyer.PositionOnScreen);
         var tile = matrix[cell];
         if (tile != null && (tile.State == TileState.Idle || tile.State == TileState.WaitDestroy))
         {
             tile.ChangeState(TileState.Destroy);
             SearchNotDestryedTile(cell, destroyer.LastCellCollision);
         }
         destroyer.LastCellCollision = cell;
     }
 }