Example #1
0
        public void RepaintForm()
        {
            mainBuffer.Graphics.Clear(Color.Ivory);
            PrintGrid.PrintGridFromForm(mainBuffer);

            foreach (Block block in gameMap)
            {
                block.PaintBlock(mainBuffer);
            }
            Shape.PaintShape(mainBuffer);
            mainBuffer.Render();
            lbScore.Text = SCORE.ToString();
        }
Example #2
0
        private void ClearForm()
        {
            mainBuffer = mainContext.Allocate(mainGraphics, new Rectangle(0, 0, pbMain.Width, pbMain.Height));
            prevBuffer = prevContext.Allocate(prevGraphics, new Rectangle(0, 0, pnPrev.Width, pnPrev.Height));

            mainBuffer.Graphics.Clear(Color.Ivory);
            PrintGrid.PrintGridFromForm(mainBuffer);
            prevBuffer.Graphics.Clear(Color.LightGray);
            gameMap.Clear();
            Shape     = null;
            prevShape = null;
            timer.Dispose();
            timer = new Timer();
        }