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(); } }
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); } }
private void Game_OnScore(Game2048Args e) => lbScore.Text = e.GetLastScore().CountScore.ToString();