Esempio n. 1
0
 protected override void determinePos(BouleSnake bs)
 {
     if (compteur > 0)
     {
         base.determinePos(bs);
     }
 }
Esempio n. 2
0
 protected override void determinePos(BouleSnake bs)
 {
     if (!fin)
     {
         base.determinePos(bs);
     }
 }
Esempio n. 3
0
 protected override void determinePos(BouleSnake bs)
 {
     if (!fin || partiesSnake.Count < hauteurJeu * largeurJeu)
     {
         base.determinePos(bs);
     }
 }
Esempio n. 4
0
        protected virtual void ajouteCorps()
        {
            BouleSnake lastBS = partiesSnake[partiesSnake.Count - 1];
            int        nouvPosX = lastBS.posX, nouvPosY = lastBS.posY;

            partiesSnake.Add(new CorpsSnake(nouvPosX, nouvPosY));
            labelTaille.Text = "Taille : " + partiesSnake.Count;
        }
Esempio n. 5
0
        protected virtual bool verifPos(BouleSnake bs)
        {
            bool posCorrecte = verifPosPomme(bs);

            posCorrecte = posCorrecte && verifPosPartie(bs);

            return(posCorrecte);
        }
Esempio n. 6
0
        protected virtual void determinePos(BouleSnake bs)
        {
            bool posCorrecte = true;

            do
            {
                bs.posX     = tirageRandLargeur();
                bs.posY     = tirageRandHauteur();
                posCorrecte = verifPos(bs);
            } while(!posCorrecte);
        }
Esempio n. 7
0
        protected bool verifPosPartie(BouleSnake bs)
        {
            foreach (BouleSnake boule in partiesSnake)
            {
                if (boule.posX == bs.posX && boule.posY == bs.posY)
                {
                    return(false);
                }
            }

            return(true);
        }
Esempio n. 8
0
        protected bool verifPosPiege(BouleSnake bs)
        {
            foreach (PiegeSnake ps in listePiege)
            {
                if (bs.posX == ps.posX && bs.posY == ps.posY)
                {
                    return(false);
                }
            }

            return(true);
        }
Esempio n. 9
0
        protected bool verifPosPomme(BouleSnake bs)
        {
            foreach (BonusSnake bonus in listeBonus)
            {
                if (bs.posX == bonus.posX && bs.posY == bonus.posY &&
                    bs != bonus)
                {
                    return(false);
                }
            }

            return(true);
        }
Esempio n. 10
0
        protected override bool verifPos(BouleSnake bs)
        {
            bool posCorrecte = base.verifPos(bs) && verifPosPiege(bs);

            return(posCorrecte);
        }