示例#1
0
 protected override void determinePos(BouleSnake bs)
 {
     if (compteur > 0)
     {
         base.determinePos(bs);
     }
 }
示例#2
0
 protected override void determinePos(BouleSnake bs)
 {
     if (!fin)
     {
         base.determinePos(bs);
     }
 }
示例#3
0
 protected override void determinePos(BouleSnake bs)
 {
     if (!fin || partiesSnake.Count < hauteurJeu * largeurJeu)
     {
         base.determinePos(bs);
     }
 }
示例#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;
        }
示例#5
0
        protected virtual bool verifPos(BouleSnake bs)
        {
            bool posCorrecte = verifPosPomme(bs);

            posCorrecte = posCorrecte && verifPosPartie(bs);

            return(posCorrecte);
        }
示例#6
0
        protected virtual void determinePos(BouleSnake bs)
        {
            bool posCorrecte = true;

            do
            {
                bs.posX     = tirageRandLargeur();
                bs.posY     = tirageRandHauteur();
                posCorrecte = verifPos(bs);
            } while(!posCorrecte);
        }
示例#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);
        }
示例#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);
        }
示例#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);
        }
示例#10
0
        protected override bool verifPos(BouleSnake bs)
        {
            bool posCorrecte = base.verifPos(bs) && verifPosPiege(bs);

            return(posCorrecte);
        }