Example #1
0
        private void button2_Click(object sender, EventArgs e)         //重新开始
        {
            if (map != null)
            {
                map = null;
            }
            map        = new BlockMap();
            this.first = second = null;
            this.pictureBox1.Invalidate();

            //修改分数,时间,求助次数,状态
            score        = 0;
            xx           = 100;
            san          = 3;
            button3.Text = "开  始";
            ChangSan();
            ChangTextBox();
            ChangTextBox2();
            ChangState("运行");
            isstart = false;

            //MessageBox.Show(t1.ThreadState.ToString());
            //线程重启
            if (t1.ThreadState == ThreadState.Aborted || t1.ThreadState == ThreadState.Stopped)
            {
                t1 = new Thread(new ThreadStart(SS1));
                t1.Start();
            }
            //挂起线程
            if (t1.ThreadState != ThreadState.Suspended)
            {
                t1.Suspend();
            }
        }
Example #2
0
        private void Start_Click(object sender, EventArgs e)
        {
            GameBox.Visible = true;
            map             = new BlockMap();
            GameBox.Size    = map.GetMapSize();
            Graphics g = GameBox.CreateGraphics();

            PaintMap(g);
            Start.Enabled     = false;
            Tip.Enabled       = true;
            MessUp.Enabled    = true;
            gameStatus        = GameStatus.Playing;
            preHit            = DateTime.Now.Ticks;
            combo             = 0;
            score             = 0;
            maxCombo          = 0;
            messUpTime        = 1;
            tipTime           = 3;
            MessUp.Text       = string.Format("打乱({0})", messUpTime);
            Tip.Text          = string.Format("提示({0})", tipTime);
            timeLeft          = 60;
            CountDown.Visible = true;
            timer             = new System.Threading.Timer(update, null, 0, 500);
        }