예제 #1
0
        private void NewGame_Click(object sender, EventArgs e)
        {
            lbGameOver.Visible = false;
            int defNum;

            int.TryParse(tbDefaultNumber.Text, out defNum);
            game.DefaultNumber = defNum;
            game.NewGame(2);
        }
예제 #2
0
        public Form1()
        {
            InitializeComponent();
            GameMode = режимToolStripMenuItem.DropDownItems.OfType <ToolStripMenuItem>().Where(m => m.Tag != null && m.Tag.ToString() == "GameMode").ToList();

            game = new Game2048(this, new Point(50, 290), new Point(4, 4), new Size(80, 80), Game_OnMove);
            game.SetBackgroundCell();
            game.NewGame();

            game.OnScore    += Game_OnScore;
            game.OnGameOver += Game_OnGameOver;
            game.OnRecord   += Game_OnRecord;
            game.OnMove     += Game_OnMove;
        }