Esempio n. 1
0
 public bool IsIntersects()
 {
     int[,] rotatedMatrix = currentShape.GetRotateShape();
     for (int i = currentShape.Y, y = 0; i < currentShape.Y + currentShape.Height; i++, y++)
     {
         for (int j = currentShape.X, x = 0; j < currentShape.X + currentShape.Width; j++, x++)
         {
             if (j >= 0 && j < MAP_WIDTH && i >= 0 && i < MAP_HEIGHT)
             {
                 if (map[i, j] != null && map[i, j] != currentShape && rotatedMatrix[y, x] != 0)
                 {
                     return(true);
                 }
             }
         }
     }
     return(false);
 }