Exemplo n.º 1
0
        private void startButton_Click(object sender, EventArgs e)
        {
            Program.form.SetGameInProgress(true);
            difficultyBoxLabel.Text = difficultyBox.SelectedItem.ToString();
            int scene = 1;

            if (timeBox.SelectedIndex == 0)
            {
                minutes = 5;
            }
            else if (timeBox.SelectedIndex == 1)
            {
                minutes = 10;
            }
            else if (timeBox.SelectedIndex == 2)
            {
                minutes = 15;
            }
            if (difficultyBox.SelectedIndex == 0)
            {
                currentHidingLocation = "Bedroom1";
                scene     = 1;
                maxClicks = 4;
                score     = 100;
            }
            else if (difficultyBox.SelectedIndex == 1)
            {
                currentHidingLocation = "Bathroom";
                scene     = 2;
                maxClicks = 3;
                score     = 200;
            }
            else if (difficultyBox.SelectedIndex == 2)
            {
                currentHidingLocation = "Storage";
                scene     = 3;
                maxClicks = 2;
                score     = 300;
            }
            clicksLabel.Text   = (maxClicks - clicks).ToString();
            gamePanel.Visible  = true;
            setupPanel.Visible = false;
            start = DateTime.Now;
            gameTimer.Start();
            api          = new DomoticzAPI(start);
            getLogThread = new Thread(api.GetLogs);
            getLogThread.Start();
            api.ToggleScene(scene);
        }