Ejemplo n.º 1
0
        private void Roll_button_Click(object sender, EventArgs e)
        {
            checkForBonus();
            updateRoundNumber();
            if (newGame.getRound() < 14)
            {
                if (newGame.getRollNumber() <= 4)
                {
                    bool[] diceToRoll = setDiceToRoll();
                    newGame.holdDice(diceToRoll);
                    int[] diceRoll = newGame.rollDice();

                    scoreCard.assignUpperScores(diceRoll);
                    scoreCard.assignLowerScore(diceRoll);
                    updateScoringLabels();

                    updateDicePicture(diceRoll, 0, pictureBox1);
                    updateDicePicture(diceRoll, 1, pictureBox2);
                    updateDicePicture(diceRoll, 2, pictureBox3);
                    updateDicePicture(diceRoll, 3, pictureBox4);
                    updateDicePicture(diceRoll, 4, pictureBox5);
                    if (newGame.getRollNumber() == 4)
                    {
                        Roll_button.Hide();
                    }
                }
            }
            else
            {
                Round_Label.Text = "";
                MessageBox.Show($"Final score: {newGame.getTotalScore()}\nThanks for playing! Restart the program to play again!");
            }
        }
Ejemplo n.º 2
0
 private void updateRoundNumber()
 {
     Round_Label.Text = $"{newGame.getRound().ToString()} of 13";
     Roll_button.Show();
 }