Пример #1
0
        //Purpose:to Display the winners and ask if the players
        //would like to play again
        //Requires:the players current cash from the player class
        //Returns:Nothing
        private void displayWinners()
        {
            Question_Box.Show();
            Question_Box.Clear();

            //Conditional statements to see who has the most cash
            if (p1.cash > p2.cash && p1.cash > p3.cash)
            {
                Question_Box.AppendText(p1.pName + " is the winner! With $" + p1.cash + "\n");
                Question_Box.AppendText("Would you like to play another game?");
            }
            else if (p2.cash > p1.cash && p2.cash > p3.cash)
            {
                Question_Box.AppendText(p2.pName + " is the winner! With $" + p2.cash + "\n");
                Question_Box.AppendText("Would you like to play another game?");
            }
            else if (p3.cash > p1.cash && p3.cash > p2.cash)
            {
                Question_Box.AppendText(p3.pName + " is the winner! With $" + p3.cash + "\n");
                Question_Box.AppendText("Would you like to play another game?");
            }
            else
            {
                Question_Box.AppendText(p1.pName + " " + p2.pName + " " + p3.pName +
                                        " Looks like no one won!\n");
                Question_Box.AppendText("Would you like to play another game?");
            }
            Yes_Button.Show();
            No_Button.Show();
        }
Пример #2
0
 //Purpose:To begin the next round
 //Requires :Nothing
 //Returns : Nothing
 private void Next_Round_button_Click(object sender, EventArgs e)
 {
     Question_Box.Show();
     Next_Round_button.Hide();
     c = 0; // resets c to 0 for player questions
     rounds();
 }
Пример #3
0
 //Purpose: When Clicked it will output the instructions for the game
 //and show and hide any components that is needed
 //Requires: Nothing
 //Returns: Nothing
 private void Play_Button_Click(object sender, EventArgs e)
 {
     Question_Box.Show();
     Question_Box.Font = new Font("Arial", 15, FontStyle.Regular);
     Question_Box.AppendText(string.Format("Welcome to the Press Your Luck Game!"));
     Question_Box.AppendText(string.Format(" This is a Game Played with Three Players!"));
     Question_Box.AppendText(string.Format(" You will first answer four trivia questions."));
     Question_Box.AppendText(string.Format(" After that starting with player."));
     Question_Box.AppendText(string.Format(" earn money"));
     Question_Box.AppendText(string.Format(" by spinning a randomly moving board."));
     Question_Box.AppendText(string.Format(" Watch out though hit a whammy and lose it all."));
     Question_Box.AppendText(string.Format("Once all names are entered please"));
     Question_Box.AppendText(string.Format(" hit Start Game to continue!\n"));
     Question_Box.AppendText(string.Format("Now, will you please enter in your name's"));
     Play_Button.Hide();
     Set_Name.Show();
     Player1_textBox.Show();
     playertwo_TextBox.Show();
     Playerthree_textBox.Show();
     Playerthree_label.Show();
     Playertwo_Label.Show();
     Playerone_Label.Show();
 }