Esempio n. 1
0
        public void reloadGame()
        {
            Image background;

            background = Image.FromFile("png/background.png");

            graphicsObj1.DrawImage(background, new Rectangle(0, 0, WINWIDTH, WINHEIGHT));

            TheGame = null;

            TheGame = new tet_game();
            TheGame.gameLoop(this, blockLogic);

            colors.initColorMatrix();
            blockLogic.initGameMatrix();

            blockLogic.usedShapesNr = 0;
            blockLogic.clearedLines = 0;
            blockLogic.myScore.resetScore();
            blockLogic.initializePieces();

            blockLogic.oldReceivedObject = null;

            blockLogic.objectToSend.enemyColorMatrix  = tet_constants.colorMatrix;
            blockLogic.objectToSend.enemyClearedLines = blockLogic.clearedLines;
            blockLogic.objectToSend.enemyUsedShapes   = blockLogic.usedShapesNr;
            blockLogic.objectToSend.enemyScore        = blockLogic.myScore.getScore();
            blockLogic.objectToSend.enemyNextShape    = blockLogic.currentShape;

            blockLogic.pushNewPiece();

            drawMyMatrix(graphicsObj1);
            drawHisMatrix(graphicsObj2, tet_constants.hisColorMatrix);

            //Image image = Image.FromFile("png/ForeverAlone.png");
            //graphicsObj2.DrawImage(image, new Rectangle(680, 100, 300, 600));

            drawMyScore(graphicsObj1);

            isGameStarted = true;
        }
Esempio n. 2
0
        public void reloadGame()
        {
            Image background;

            background = Image.FromFile("png/background.png");

            graphicsObj1.DrawImage(background, new Rectangle(0, 0, WINWIDTH, WINHEIGHT));

            TheGame = null;

            TheGame = new tet_game();
            TheGame.gameLoop(this, blockLogic);

            colors.initColorMatrix();
            blockLogic.initGameMatrix();

            blockLogic.usedShapesNr = 0;
            blockLogic.clearedLines = 0;
            blockLogic.myScore.resetScore();
            blockLogic.initializePieces();

            blockLogic.oldReceivedObject = null;

            blockLogic.objectToSend.enemyColorMatrix = tet_constants.colorMatrix;
            blockLogic.objectToSend.enemyClearedLines = blockLogic.clearedLines;
            blockLogic.objectToSend.enemyUsedShapes = blockLogic.usedShapesNr;
            blockLogic.objectToSend.enemyScore = blockLogic.myScore.getScore();
            blockLogic.objectToSend.enemyNextShape = blockLogic.currentShape;

            blockLogic.pushNewPiece();

            drawMyMatrix(graphicsObj1);
            drawHisMatrix(graphicsObj2, tet_constants.hisColorMatrix);

            //Image image = Image.FromFile("png/ForeverAlone.png");
            //graphicsObj2.DrawImage(image, new Rectangle(680, 100, 300, 600));

            drawMyScore(graphicsObj1);

            isGameStarted = true;
        }