Example #1
0
        public victoryForm(PLAYER player, int turns, DIFFICULTY difficulty, Form1 currentForm, Users user)
        {
            InitializeComponent();
            form        = currentForm;
            cDifficulty = difficulty;
            currentUser = user;
            scoreboard  = new Scoreboard(currentUser);

            switch (player)
            {
            case PLAYER.player:
                victoryLbl.Text = $"{currentUser.playerName}'s {victoryLbl.Text}";
                scoreboard.updateRecords(turns, difficulty, currentUser.playerName);
                victorySound.Play();
                break;

            case PLAYER.computer:
                victoryLbl.Text     = $"{computerName}'s {victoryLbl.Text}";
                nxtLvlBtn.BackColor = Color.FromArgb(150, Color.Violet);
                nxtLvlBtn.Enabled   = false;
                failureSound.Play();
                break;

            default:
                victoryLbl.Text = "Victory!";
                break;
            }

            turnLbl.Text = $"Score: {scoreboard.getScore(turns, difficulty)}";

            if (difficulty == DIFFICULTY.HARD)
            {
                nxtLvlBtn.BackColor = Color.FromArgb(150, Color.Violet);
                nxtLvlBtn.Enabled   = false;
            }
        }
Example #2
0
 // Constructors
 public GameSettings()
 {
     InitializeComponent();
     Scoreboard scoreboard = new Scoreboard(currentUser);
 }