示例#1
0
文件: Fifteen.cs 项目: bl1n41k/lab4
 private void Fifteen_KeyDown_1(object sender, KeyEventArgs e)
 {
     if (e.KeyValue == 8)
     {
         Restore();        // клавиша Backspace отменяет ход
     }
     if (e.KeyValue == 32) // читы
     {
         timer1.Stop();
         Victory victory = new Victory(count, sec);
         victory.ShowDialog();
         GameStart();
     }
 }
示例#2
0
文件: Fifteen.cs 项目: bl1n41k/lab4
        private void Button_Click(object sender, EventArgs e)
        {
            int position = Convert.ToInt32(((Button)sender).Tag);

            if (game.Shift(position))//перемещение
            {
                RefreshButtonField();
                count++;
                CountStatus.Text = count.ToString();
            }
            if (game.Check())//Завершение игры
            {
                timer1.Stop();
                Victory victory = new Victory(count, sec);
                victory.ShowDialog();
                GameStart();
            }
            this.ActiveControl = null;
        }