private void button1_Click(object sender, EventArgs e)
        {
            String code  = textBox1.Text;
            bool   found = false;

            foreach (CardEvent c in Global.cardDatabase)
            {
                if (c.cardCode.Equals(code.ToUpper()))
                {
                    Global.currentCardEvent = c;
                    found = true;
                }
            }
            if (!found)
            {
                MessageBox.Show("The code that has been entered does not match any of the cards.", "Invalid Code", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                Global.isCard = true;
                Global.currentCardEvent.initEvent();
                Form newGame = new ResultScreen();
                newGame.Show();
                newGame.Location = this.Location;
                this.Hide();
            }
        }
Exemple #2
0
        private void choice2_Click(object sender, EventArgs e)
        {
            Global.currentEvent.choice2();
            Form newGame = new ResultScreen();

            newGame.Show();
            newGame.Location = this.Location;
            this.Hide();
        }
        private void TurnScreen_Load(object sender, EventArgs e)
        {
            if (checkEndGame())
            {
                Form newGame = new GameOver();
                newGame.Show();
                newGame.Location = this.Location;
                this.Hide();
                Global.playerTurn = -1;
            }

            if (Global.playerTurn == 1)
            {
                if (Global.p1.tilePos >= Global.endPos)
                {
                    ResultScreen skip = new ResultScreen();
                    skip.turnOverride();
                }
                label1.Text = "Player 1's Turn";
            }
            else if (Global.playerTurn == 2)
            {
                if (Global.p2.tilePos >= Global.endPos)
                {
                    ResultScreen skip = new ResultScreen();
                    skip.turnOverride();
                }
                label1.Text = "Player 2's Turn";
            }
            else if (Global.playerTurn == 3)
            {
                if (Global.p3.tilePos >= Global.endPos)
                {
                    ResultScreen skip = new ResultScreen();
                    skip.turnOverride();
                }
                label1.Text = "Player 3's Turn";
            }
            else if (Global.playerTurn == 4)
            {
                if (Global.p4.tilePos >= Global.endPos)
                {
                    ResultScreen skip = new ResultScreen();
                    skip.turnOverride();
                }
                label1.Text = "Player 4's Turn";
            }
            else if (Global.playerTurn == 5)
            {
                if (Global.p5.tilePos >= Global.endPos)
                {
                    ResultScreen skip = new ResultScreen();
                    skip.turnOverride();
                }
                label1.Text = "Player 5's Turn";
            }
            if (Global.playerTurn != -1)
            {
                timer1.Start();
            }
        }