Beispiel #1
0
 public void AddPixel(CPixel pixel)
 {
     if (!Lines.ContainsKey(pixel.Y))
     {
         Lines[pixel.Y] = new CLine();
     }
     Lines[pixel.Y].Pixels.Add(pixel);
 }
Beispiel #2
0
        CPixel TranslatePixelFromShapeToGame(CPixel shapePixel)
        {
            shapePixel.X = shapePixel.ShapeX * PixelSize + CurrenntShape.X;
            shapePixel.Y = shapePixel.ShapeY * PixelSize + CurrenntShape.Y;

            return shapePixel;
        }
        void RegisterPixelColor(CPixel pixel, Color color)
        {
            if (m_tetrisGame.CurrenntShape.Pixels.Find(delegate(CPixel cp1)
            {
                return cp1.X == pixel.X && cp1.Y == pixel.Y;
            }) == null)
            {
                return;
            }

            if (m_mapPixleColors.ContainsKey(pixel))
            {
                m_mapPixleColors[pixel] = color;
            }
            else
            {
                m_mapPixleColors.Add(pixel, color);
            }
        }
Beispiel #4
0
 bool IsPixelsCollapsed(CPixel what, CPixel with)
 {
     if (what.X + PixelSize > with.X && what.X + PixelSize <= with.X + PixelSize &&
         what.Y + PixelSize > with.Y && what.Y + PixelSize <= with.Y + PixelSize)
     {
         return true;
     }
     return false;
 }
 Color GetPixelColor(CPixel pixel)
 {
     if (m_mapPixleColors.ContainsKey(pixel))
     {
         return m_mapPixleColors[pixel];
     }
     return Color.Red;
 }