Example #1
0
        private void btnHightScore_Click(object sender, EventArgs e)
        {
            if (!checkBackgroundMusic)
            {
                backgroundMusic.Menu();
                checkBackgroundMusic = !checkBackgroundMusic;
            }

            LoadHightScore();

            pictureBox.BringToFront();
            pictureBox.Visible = true;
            pictureBox.Image   = game3.Properties.Resources.background_score;
            this.KeyPreview    = false;

            btnPlay.Iconimage = game3.Properties.Resources.play;
            btnPlay.Text      = "     Play";
            checkPlay         = !checkPlay;

            lblHightScore.Visible = Score1.Visible = Score3.Visible = Score2.Visible = true;
            lblHightScore.BringToFront();
            Score1.BringToFront();
            Score2.BringToFront();
            Score3.BringToFront();
        }
Example #2
0
 void ShowScores()
 {
     p1.text = Player1;
     p2.text = Player2;
     p3.text = Player3;
     p4.text = Player4;
     p5.text = Player5;
     s1.text = Score1.ToString();
     s2.text = Score2.ToString();
     s3.text = Score3.ToString();
     s4.text = Score4.ToString();
     s5.text = Score5.ToString();
 }
Example #3
0
    public int GetScoreOfArea11(int result, ref bool isShown1, ref bool isShown2, ref bool isShown3)
    {
        int score = 0;

        switch (result)
        {
        case 0:
            score = 0;
            break;

        case 1:
            if (Regex.Match(Score1.GetComponentInChildren <Text>().text.ToString(), @"\d").Success)
            {
                score += (int)float.Parse(Score1.GetComponentInChildren <Text>().text.ToString());
            }
            break;

        case 2:
            if (Regex.Match(Score1.GetComponentInChildren <Text>().text.ToString(), @"\d").Success)
            {
                score += (int)float.Parse(Score1.GetComponentInChildren <Text>().text.ToString());
            }
            if (!isShown1)
            {
                biscuit.SetActive(true);
                isShown1 = true;
                Debug.Log("Eraser1 appeared");
            }
            break;

        case 3:
            if (Regex.Match(Score1.GetComponentInChildren <Text>().text.ToString(), @"\d").Success)
            {
                score += (int)float.Parse(Score1.GetComponentInChildren <Text>().text.ToString());
            }
            if (Regex.Match(Score2.GetComponentInChildren <Text>().text.ToString(), @"\d").Success)
            {
                score += (int)float.Parse(Score2.GetComponentInChildren <Text>().text.ToString());
            }
            break;

        case 4:
            if (Regex.Match(Score1.GetComponentInChildren <Text>().text.ToString(), @"\d").Success)
            {
                score += (int)float.Parse(Score1.GetComponentInChildren <Text>().text.ToString());
            }
            if (Regex.Match(Score2.GetComponentInChildren <Text>().text.ToString(), @"\d").Success)
            {
                score += (int)float.Parse(Score2.GetComponentInChildren <Text>().text.ToString());
            }
            if (!isShown2)
            {
                biscuit.SetActive(true);
                isShown2 = true;
            }
            break;

        case 5:
            if (Regex.Match(Score1.GetComponentInChildren <Text>().text.ToString(), @"\d").Success)
            {
                score += (int)float.Parse(Score1.GetComponentInChildren <Text>().text.ToString());
            }
            if (Regex.Match(Score2.GetComponentInChildren <Text>().text.ToString(), @"\d").Success)
            {
                score += (int)float.Parse(Score2.GetComponentInChildren <Text>().text.ToString());
            }
            if (Regex.Match(Score3.GetComponentInChildren <Text>().text.ToString(), @"\d").Success)
            {
                score += (int)float.Parse(Score3.GetComponentInChildren <Text>().text.ToString());
            }
            break;

        case 6:
            if (Regex.Match(Score1.GetComponentInChildren <Text>().text.ToString(), @"\d").Success)
            {
                score += (int)float.Parse(Score1.GetComponentInChildren <Text>().text.ToString());
            }
            if (Regex.Match(Score2.GetComponentInChildren <Text>().text.ToString(), @"\d").Success)
            {
                score += (int)float.Parse(Score2.GetComponentInChildren <Text>().text.ToString());
            }
            if (Regex.Match(Score3.GetComponentInChildren <Text>().text.ToString(), @"\d").Success)
            {
                score += (int)float.Parse(Score3.GetComponentInChildren <Text>().text.ToString());
            }
            if (!isShown3)
            {
                biscuit.SetActive(true);
                isShown3 = true;
            }
            break;
        }

        return(score);
    }
Example #4
0
        public void AvailableMoves(string[,] gameBg, CollisionDect dect)
        {
            //clears list each time function is used
            Score0.Clear();
            Score1.Clear();
            Score2.Clear();
            Score3.Clear();

            for (int x = 2; x <= 9; x++)
            {
                for (int y = 2; y <= 9; y++)
                {
                    //down for downward movement
                    //finds moves for O or kO looks looks for a space DOWN and RIGHT and ethier a X or kX
                    if ((gameBg[x, y] == "O " || gameBg[x, y] == "kO") && gameBg[x + 1, y - 1] == "\0 " && gameBg[x + 2, y - 2] == "X " || gameBg[x + 2, y - 2] == "kX")
                    {
                        int tempX = x + 1;
                        int tempY = y - 1;
                        dect.AnotherMove = false;
                        score0.Add(x.ToString() + "," + y.ToString() + "-" + tempX.ToString() + "," + tempY.ToString());
                    }
                    //finds moves for O or kO looks looks for a space DOWN and LEFT and ethier a X or kX
                    if ((gameBg[x, y] == "O " || gameBg[x, y] == "kO") && gameBg[x + 1, y + 1] == "\0 " && gameBg[x + 2, y + 2] == "X " || gameBg[x + 2, y + 2] == "kX")
                    {
                        int tempX = x + 1;
                        int tempY = y + 1;
                        dect.AnotherMove = false;
                        score0.Add(x.ToString() + "," + y.ToString() + "-" + tempX.ToString() + "," + tempY.ToString());
                    }
                    //finds moves for O or kO looks looks for a space DOWN and RIGHT and a space DOWN and RIGHT
                    if ((gameBg[x, y] == "O " || gameBg[x, y] == "kO") && gameBg[x + 1, y - 1] == "\0 " && gameBg[x + 2, y - 2] == "\0 ")
                    {
                        int tempX = x + 1;
                        int tempY = y - 1;
                        dect.AnotherMove = false;
                        score1.Add(x.ToString() + "," + y.ToString() + "-" + tempX.ToString() + "," + tempY.ToString());
                    }
                    //finds moves for O or kO looks looks for a space DOWN and RIGHT and a space DOWN and LEFT
                    if ((gameBg[x, y] == "O " || gameBg[x, y] == "kO") && gameBg[x + 1, y + 1] == "\0 " && gameBg[x + 2, y + 2] == "\0 ")
                    {
                        int tempX = x + 1;
                        int tempY = y + 1;
                        dect.AnotherMove = false;
                        score1.Add(x.ToString() + "," + y.ToString() + "-" + tempX.ToString() + "," + tempY.ToString());
                    }
                    //finds moves for O or kO looks looks for a space DOWN and RIGHT and a space DOWN and RIGHT
                    if ((gameBg[x, y] == "O " || gameBg[x, y] == "kO") && gameBg[x + 1, y - 1] == "\0 " && gameBg[x + 2, y - 2] == "N ")
                    {
                        int tempX = x + 1;
                        int tempY = y - 1;
                        dect.AnotherMove = false;
                        score1.Add(x.ToString() + "," + y.ToString() + "-" + tempX.ToString() + "," + tempY.ToString());
                    }
                    //finds moves for O or kO looks looks for a space DOWN and LEFT and a space DOWN and LEFT
                    if ((gameBg[x, y] == "O " || gameBg[x, y] == "kO") && gameBg[x + 1, y + 1] == "\0 " && gameBg[x + 2, y + 2] == "N ")
                    {
                        int tempX = x + 1;
                        int tempY = y + 1;
                        dect.AnotherMove = false;
                        score1.Add(x.ToString() + "," + y.ToString() + "-" + tempX.ToString() + "," + tempY.ToString());
                    }
                    //finds moves for O or kO looks looks for a space DOWN and RIGHT and a space DOWN and RIGHT
                    if ((gameBg[x, y] == "O " || gameBg[x, y] == "kO") && gameBg[x + 1, y - 1] == "X " && (gameBg[x + 2, y - 2] == "\0 "))
                    {
                        int tempX = x + 1;
                        int tempY = y - 1;
                        dect.CheckerTaken = true;
                        score2.Add(x.ToString() + "," + y.ToString() + "-" + tempX.ToString() + "," + tempY.ToString());
                    }
                    //finds moves for O or kO looks looks for a space DOWN and LEFT and a space DOWN and LEFT
                    if ((gameBg[x, y] == "O " || gameBg[x, y] == "kO") && gameBg[x + 1, y + 1] == "X " && gameBg[x + 2, y + 2] == "\0 ")
                    {
                        int tempX = x + 1;
                        int tempY = y + 1;
                        dect.CheckerTaken = true;
                        score2.Add(x.ToString() + "," + y.ToString() + "-" + tempX.ToString() + "," + tempY.ToString());
                    }
                    //finds moves for O or kO looks looks for a space DOWN and RIGHT and a space DOWN and RIGHT
                    if ((gameBg[x, y] == "O " || gameBg[x, y] == "kO") && gameBg[x + 1, y - 1] == "kX" && (gameBg[x + 2, y - 2] == "\0 "))
                    {
                        int tempX = x + 1;
                        int tempY = y - 1;
                        dect.CheckerTaken = true;
                        score3.Add(x.ToString() + "," + y.ToString() + "-" + tempX.ToString() + "," + tempY.ToString());
                    }
                    //finds moves for O or kO looks looks for a space DOWN and LEFT and a space DOWN and LEFT
                    if ((gameBg[x, y] == "O " || gameBg[x, y] == "kO") && gameBg[x + 1, y + 1] == "kX" && gameBg[x + 2, y + 2] == "\0 ")
                    {
                        int tempX = x + 1;
                        int tempY = y + 1;
                        dect.CheckerTaken = true;
                        score3.Add(x.ToString() + "," + y.ToString() + "-" + tempX.ToString() + "," + tempY.ToString());
                    }
                    //checks for O and kO checks if the row is 9 so checker changes to king down and RIGHT for space
                    if (gameBg[x, y] == "O " && x == 9 && gameBg[x + 1, y - 1] == "\0 ")
                    {
                        int tempX = x + 1;
                        int tempY = y - 1;
                        dect.AnotherMove = false;
                        score4.Add(x.ToString() + "," + y.ToString() + "-" + tempX.ToString() + "," + tempY.ToString());
                    }
                    //checks for O and kO checks if the row is 9 so checker changes to king down and LEFT for space
                    if (gameBg[x, y] == "O " && x == 9 && gameBg[x + 1, y + 1] == "\0 ")
                    {
                        int tempX = x + 1;
                        int tempY = y + 1;
                        dect.AnotherMove = false;
                        score4.Add(x.ToString() + "," + y.ToString() + "-" + tempX.ToString() + "," + tempY.ToString());
                    }
                    //*******************************************************************************************88
                    //up movement for kings
                    //finds moves f kO looks for a space UP and RIGHT and a space DOWN and RIGHT
                    if (gameBg[x, y] == "kO" && gameBg[x - 1, y + 1] == "kX" && (gameBg[x - 2, y + 2] == "\0 "))
                    {
                        int tempX = x - 1;
                        int tempY = y + 1;
                        dect.CheckerTaken = true;
                        score4.Add(x.ToString() + "," + y.ToString() + "-" + tempX.ToString() + "," + tempY.ToString());
                    }
                    //finds moves for  kO looks for a space UP and LEFT and a space DOWN and LEFT
                    if (gameBg[x, y] == "kO" && gameBg[x - 1, y - 1] == "kX" && gameBg[x - 2, y - 2] == "\0 ")
                    {
                        int tempX = x - 1;
                        int tempY = y - 1;
                        dect.CheckerTaken = true;
                        score4.Add(x.ToString() + "," + y.ToString() + "-" + tempX.ToString() + "," + tempY.ToString());
                    }
                    //*******************************************************************************************88
                    if (gameBg[x, y] == "kO" && gameBg[x - 1, y - 1] == "\0 " && gameBg[x - 2, y - 2] == "N ")
                    {
                        int tempX = x - 1;
                        int tempY = y - 1;
                        dect.AnotherMove = false;
                        score1.Add(x.ToString() + "," + y.ToString() + "-" + tempX.ToString() + "," + tempY.ToString());
                    }
                    //finds moves for O or kO looks looks for a space DOWN and LEFT and a space DOWN and LEFT
                    if (gameBg[x, y] == "kO" && gameBg[x - 1, y - 1] == "\0 " && gameBg[x - 2, y - 2] == "N ")
                    {
                        int tempX = x - 1;
                        int tempY = y - 1;
                        dect.AnotherMove = false;
                        score1.Add(x.ToString() + "," + y.ToString() + "-" + tempX.ToString() + "," + tempY.ToString());
                    }
                    //finds moves for O or kO looks looks for a space DOWN and RIGHT and a space UP and RIGHT
                    if (gameBg[x, y] == "kO" && gameBg[x - 1, y + 1] == "X " && (gameBg[x - 2, y + 2] == "\0 "))
                    {
                        int tempX = x - 1;
                        int tempY = y + 1;
                        dect.CheckerTaken = true;
                        score2.Add(x.ToString() + "," + y.ToString() + "-" + tempX.ToString() + "," + tempY.ToString());
                    }
                    //finds moves for O or kO looks looks for a space DOWN and LEFT and a space DOWN and LEFT
                    if (gameBg[x, y] == "kO" && gameBg[x - 1, y + 1] == "X " && gameBg[x - 2, y + 2] == "\0 ")
                    {
                        int tempX = x - 1;
                        int tempY = y + 1;
                        dect.CheckerTaken = true;
                        score2.Add(x.ToString() + "," + y.ToString() + "-" + tempX.ToString() + "," + tempY.ToString());
                    }
                    //finds moves for O or kO looks looks for a space DOWN and RIGHT and a space DOWN and RIGHT
                    if (gameBg[x, y] == "kO" && gameBg[x - 1, y - 1] == "kX" && gameBg[x - 2, y - 2] == "\0 ")
                    {
                        int tempX = x - 1;
                        int tempY = y - 1;
                        dect.CheckerTaken = true;
                        score3.Add(x.ToString() + "," + y.ToString() + "-" + tempX.ToString() + "," + tempY.ToString());
                    }
                }
            }
        }