Ejemplo n.º 1
0
        public bool Eat(MyPoint food)
        {
            MyPoint head = GetNextPoint();

            if (head.IsHit(food))
            {
                food.symbol = head.symbol;
                pointList.Add(food);
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 2
0
        public bool Eat(MyPoint food) //uss sööb point, millel on omad koordinaadid
        {
            MyPoint head = GetNextPoint();

            if (head.IsHit(food))          //kui see on true, siis ta lisab ussile kasvu
            {
                food.symbol = head.symbol; //kui ta sööb ära, siis uss suureneb
                pointList.Add(food);

                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 3
0
 public bool EatBadFood(MyPoint badF)
 {
     
     //Console.ForegroundColor = ConsoleColor.DarkRed;
     MyPoint head = GetNextPoint();
     if (head.IsHit(badF))
     {
         badF.symbol = head.symbol;
         pointList.Add(badF); //kui sööb toidu ära, muutub osaks ussist.
         //scorePoint--;
         return true;
     }
     else
     {
         return false;
     }
 }
Ejemplo n.º 4
0
 public bool EatGoodFood(MyPoint goodF)
 {
     
     //Console.ForegroundColor = ConsoleColor.Green;
     MyPoint head = GetNextPoint();
     if (head.IsHit(goodF))
     {
         goodF.symbol = head.symbol;
         pointList.Add(goodF); //kui sööb toidu ära, muutub osaks ussist.
         //scorePoint += 2;
         return true;
     }
     else
     {
         return false;
     }
 }