Exemplo n.º 1
0
        //Starts a new turn
        public static void NewTurn()
        {
            //Checks if the game is over
            if (CheckGameOver() || GameSetOver)
            {
                GameOver();
                Board.timer1.Stop();
            }
            else
            {
                CardClickAllowence(true);
                TurnBackCards();
                Board.Namechange(ActivePlayerIndex);

                //Check if the active player is an AI player and what difficulty if so
                if (PlayerList.list[ActivePlayerIndex].AI == true && PlayerList.list[ActivePlayerIndex].Skill == 1)
                {
                    CardClickAllowence(false);
                    AIeasy.PlayAI(Board);
                }
                else if (PlayerList.list[ActivePlayerIndex].AI == true && PlayerList.list[ActivePlayerIndex].Skill == 2)
                {
                    CardClickAllowence(false);
                    AIhard.PlayAI(Board);
                }
            }
        }
Exemplo n.º 2
0
 private void timer4_Tick(object sender, EventArgs e)
 {
     if (timeLeftCard > 0)
     // if there's time left reduce time by 1 and update label every sec.
     {
         timeLeftCard = timeLeftCard - 1;
     }
     else
     // If time's up announce by changing label.
     {
         timer4.Stop();
         AIeasy.NextCard();
     }
 }