Exemple #1
0
 public bool Win()
 {
     if (Fieldek[Fieldek.GetLength(0) - 1, Fieldek.GetLength(1) - 1].Background == Brushes.Green)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Exemple #2
0
 public void SetAkadalyok()
 {
     for (int i = 2; i < Fieldek.GetLength(0); i += 3)
     {
         for (int j = 0; j < Fieldek.GetLength(1); j += 4)
         {
             //Fieldek[i, j].Background = Brushes.Black;
             Fieldek[Fieldek.GetLength(0) - 12, Fieldek.GetLength(1) - 1].Background = Brushes.Yellow;
             Fieldek[Fieldek.GetLength(0) - 6, Fieldek.GetLength(1) - 8].Background  = Brushes.Yellow;
             Fieldek[Fieldek.GetLength(0) - 1, Fieldek.GetLength(1) - 1].Background  = Brushes.Blue;
         }
     }
     StartPoint();
 }
Exemple #3
0
 public int CollectYellows(ref int countelso, ref int countmasodik)
 {
     if (Fieldek[Fieldek.GetLength(0) - 12, Fieldek.GetLength(1) - 1].Background == Brushes.Green && countelso < 1)
     {
         countelso++;
         return(1);
     }
     else if (Fieldek[Fieldek.GetLength(0) - 6, Fieldek.GetLength(1) - 8].Background == Brushes.Green && countmasodik < 1)
     {
         countmasodik++;
         return(1);
     }
     else
     {
         return(0);
     }
 }
Exemple #4
0
        public void SetStars()
        {
            for (int i = 0; i < Fieldek.GetLength(0); i++)
            {
                for (int j = 0; j < Fieldek.GetLength(1); j++)
                {
                    if (Fieldek[i, j].Background == Brushes.Green)
                    {
                        return;
                    }
                }
            }

            foreach (var star in Stars)
            {
                Fieldek[star.X, star.Y].Background = Brushes.Yellow;
            }
        }
Exemple #5
0
        public void StartPoint()
        {
            bool isPlayer = false;

            for (int i = 0; i < Fieldek.GetLength(0); i++)
            {
                for (int j = 0; j < Fieldek.GetLength(1); j++)
                {
                    if (Fieldek[i, j].Background == Brushes.Green)
                    {
                        isPlayer = true;
                    }
                }
            }
            if (isPlayer == false)
            {
                Fieldek[0, 0].Background = Brushes.Green;
            }
        }
Exemple #6
0
        public void FelLeptet()
        {
            int db = 0;

            for (int i = 0; i < Fieldek.GetLength(0); i++)
            {
                for (int j = 1; j < Fieldek.GetLength(1); j++)
                {
                    if (Fieldek[i, j].Background == Brushes.Green && db < 1)
                    {
                        if (Fieldek[i, j - 1].Background != Brushes.Black)
                        {
                            Fieldek[i, j - 1].Background = Brushes.Green;
                            Fieldek[i, j].Background     = Brushes.LightGray;
                            db++;
                        }
                    }
                }
            }
        }