Esempio n. 1
0
        public void Draw()
        {
            Graphics g = Game.Graphics;

            NextFigure.Draw(g);
            ScoreUI.Draw(g);

            int rowoff = -Y;

            g.DrawLine(BorderPen, X, Y + rowoff, X, Y + Rows * BlockWH + rowoff);
            g.DrawLine(BorderPen, X, Y + Rows * BlockWH + rowoff, X + Cols * BlockWH, Y + Rows * BlockWH + rowoff);
            g.DrawLine(BorderPen, X + Cols * BlockWH, Y + Rows * BlockWH + rowoff, X + Cols * BlockWH, Y + rowoff);//border

            int nextFigureBorderOffsetY = 20;
            int y = nextFigureBorderOffsetY + BlockWH * 2;

            g.DrawRectangle(BorderPen, RightX, y, BlockWH * 5, BlockWH * 6);//next figure border
            nextFigure.X = RightX + BlockWH;
            nextFigure.Y = y + BlockWH;
            nextFigure.Draw(g);

            for (int i = 0; i < Cols; i++)
            {
                for (int j = 0; j < Rows; j++)
                {
                    if (Grid[i][j] != null)
                    {
                        int posx = i * BlockWH + X;
                        int posy = j * BlockWH;
                        g.FillRectangle(Grid[i][j].Brush, posx, posy, BlockWH, BlockWH);
                    }
                }
            }
        }
Esempio n. 2
0
 public void Dispose()
 {
     FigureChange -= OnFigureChange;
     FigureChange -= OnRowDestroy;
     GoFast        = false;
     ScoreUI.Dispose();
     NextFigure.Dispose();
     SoundPlayer.Dispose();
 }