예제 #1
0
 private void Game2048_OnScore(Game2048Args e)
 {
     if (e.GetLastScore().CountScore > Record.CountScore)
     {
         Record = e.GetLastScore();
         OnRecord?.Invoke(args);
     }
     if (e.MaxNumberNow >= NumberForWin && !InfinityMode)
     {
         IsWin = true;
         GameOver();
     }
 }
예제 #2
0
        private void Animation_OnMix(Cage cage)
        {
            List <Cage> deleteCages = Cages.Where(c => c.Number == -1).ToList();

            for (int i = 0; i < deleteCages.Count; i++)
            {
                MainForm.Controls.Remove(deleteCages[i]);
                Cages.Remove(deleteCages[i]);
            }

            cage.ApplyNumber();
            if (cage.Number > MaxNumberNow)
            {
                MaxNumberNow = cage.Number;
            }
            Score = new Score(args.GetLastScore().CountScore + cage.Number, CountMove);
            OnScore?.Invoke(args);
            if (cage.Number > 99)
            {
                cage.Font = new Font("Google Sans", 22, FontStyle.Regular);
            }
            if (cage.Number > 512)
            {
                cage.Font = new Font("Google Sans", 18, FontStyle.Regular);
            }
            if (cage.Number > 8192)
            {
                cage.Font = new Font("Google Sans", 14, FontStyle.Regular);
            }
        }
예제 #3
0
 private void Game_OnScore(Game2048Args e) => lbScore.Text = e.GetLastScore().CountScore.ToString();