예제 #1
0
 private void PlayBtn_Click(object sender, EventArgs e)
 {
     MainMenuPanel.Visible = false;
     resetGame();
     PrimaryTimer.Start();
     FiredPnl.Visible = false;
 }
예제 #2
0
        private void resetGame()
        {
            totalScore        = 0;
            totalDispatches   = 0;
            averageDispatches = 0;
            gameLost          = false;

            PrimaryTimer.Stop();

            for (int x = 0; x < gameBoardHeight; x++)
            {
                for (int y = 0; y < gameBoardWidth; y++)
                {
                    btn[x, y].BackgroundImage = BoxGame.Properties.Resources.emptyslot;
                    btn[x, y].Tag             = "empty";
                }
            }

            // When the form has loaded we mark out the parts of the grid for the belt
            for (int x = 0; x < gameBoardWidth; x++)
            {
                for (int y = 0; y < 2; y++)
                {
                    btn[x, y].BackgroundImage = BoxGame.Properties.Resources.beltarea;
                }
            }
            tickCounter = 0;
            PrimaryTimer.Start();
        }
예제 #3
0
 // Cant rename this
 private void button1_Click_1(object sender, EventArgs e)
 {
     Console.WriteLine("The game is " + gameLost);
     if (paused && gameLost == false)
     {
         paused = false;
         pauseButton.BackgroundImage = BoxGame.Properties.Resources.pausebutton;
         PrimaryTimer.Start();
     }
     else if (!paused && gameLost == false)
     {
         paused = true;
         pauseButton.BackgroundImage = BoxGame.Properties.Resources.unpausebutton;
         PrimaryTimer.Stop();
     }
 }