Exemple #1
0
 private bool IsHit(Point point)
 {
     foreach (var p in pList)
     {
         if (point.IsHit(p))
             return true;
     }
     return false;
 }
Exemple #2
0
 internal bool IsHit(Point point)
 {
     foreach (var p in points)
     {
         if (point.IsHit(p))
             return true;
     }
     return false;
 }
Exemple #3
0
 public bool IsHit(Point point)
 {
     foreach (var p in PList)
     {
         if (point.IsHit(p))
         {
             return(true);
         }
     }
     return(false);
 }
Exemple #4
0
        internal bool IsHitWalls(Point point)
        {
            Point head = pList.Last();

            if (head.IsHit(point))
            {
                return(true);
            }

            return(false);
        }
Exemple #5
0
 private bool IsHit(Point point)
 {
     foreach (var p in pList)
     {
         if (point.IsHit(p))
         {
             return(true);
         }
     }
     return(false);
 }
Exemple #6
0
 internal bool IsHit(Point point)
 {
     foreach (var p in points)
     {
         if (point.IsHit(p))
         {
             return(true);
         }
     }
     return(false);
 }
Exemple #7
0
        internal bool Eat(Point food)
        {
            Point head = GetNextPoint();

            if (head.IsHit(food))
            {
                food.sym = head.sym;
                pList.Add(food);
                return(true);
            }
            return(false);
        }
Exemple #8
0
        internal bool Eat(Point food)
        {
            Point head = GetNextPoint();

            if (head.IsHit(food))
            {
                food.Change(head);
                pline.Add(head);
                return(true);
            }
            return(false);
        }
Exemple #9
0
        internal bool IsHit()
        {
            Point h = new Point(points.Last());

            for (int i = 0; i < points.Count - 2; ++i)
            {
                if (h.IsHit(points[i]))
                {
                    return(true);
                }
            }
            return(false);
        }
Exemple #10
0
        internal bool IsHitFood(Point food)
        {
            Point head = pList.Last();

            for (int i = 0; i < pList.Count - 2; i++)
            {
                if (food.IsHit(pList[i]))
                {
                    return(true);
                }
            }
            return(false);
        }
Exemple #11
0
        public bool Eat(Point food)
        {
            Point head = GetNextPoint();

            if (head.IsHit(food))
            {
                food.Sym = head.Sym;
                _pList.Add(food);
                Score++;
                return(true);
            }
            return(false);
        }
Exemple #12
0
        public bool Eat(Point food)
        {
            Point head    = _points.Last();
            bool  isEaten = head.IsHit(food);

            if (isEaten)
            {
                score++;
                _points.Add(food);
            }

            return(isEaten);
        }
Exemple #13
0
        public bool IsHitTail()
        {
            Point head = pline.Last();

            for (int i = 0; i < pline.Count - 1; i++)
            {
                if (head.IsHit(pline[i]))
                {
                    return(true);
                }
            }
            return(false);
        }
Exemple #14
0
        public bool IsHit()
        {
            Point head = pList.Last();

            for (int i = 0; i < pList.Count - 2; i++)
            {
                if (head.IsHit(pList[i]))
                {
                    return(true);
                }
            }
            return(false);
        }
Exemple #15
0
        /// <summary>
        /// Столкнулась ли с хвостом
        /// </summary>
        /// <returns></returns>
        public bool IsHitTail()
        {
            Point head = points.Last();

            for (int i = 0; i < points.Count - 2; i++)
            {
                if (head.IsHit(points[i]))
                {
                    return(true);
                }
            }
            return(false);
        }
Exemple #16
0
        internal bool IsHitTail()
        {
            Point head = pointList.Last();

            for (int i = 0; i < pointList.Count - 2; i++)
            {
                if (head.IsHit(pointList[i]))
                {
                    return(true);
                }
            }
            return(false);
        }
Exemple #17
0
        internal bool Eat(Point food)
        {
            Point head     = GetNextPoint();
            Point tempFood = null;

            if (head.IsHit(food))
            {
                food.symbol = head.symbol;
                pointList.Add(food);
                Score.score += 1;

                for (int i = 0; i < pointList.Count; i++)
                {
                    if (!food.IsHit(pointList[i]))
                    {
                        if (head.IsHit(food))
                        {
                            if (!food.IsHit(GetNextPoint()))
                            {
                                head.Clear();
                                food.Draw();
                            }
                        }
                    }
                }
                if (HorizontalSpeed > 50)
                {
                    HorizontalSpeed -= 10;
                }
                if (VerticalSpeed > 100)
                {
                    VerticalSpeed -= 10;
                }
                tempFood = food;
                return(true);
            }
            return(false);
        }
Exemple #18
0
        public bool Eat(Point food)
        {
            Point head = GetNextPoint();

            if (head.IsHit(food))
            {
                food.Symbol = head.Symbol;
                food.Draw();
                _points.Add(food);
                return(true);
            }

            return(false);
        }
Exemple #19
0
        public bool Eat(Point food)
        {
            //Point head = GetNextPoint();
            Point head = points.Last();

            // Питание происходит при совпадении с точкой головы змейки
            if (head.IsHit(food))
            {
                food.Symbol = head.Symbol;
                points.Add(food);
                return(true);
            }
            return(false);
        }
Exemple #20
0
        internal bool Eat(Point food)
        {
            Point head = GetNextPoint();

            if (head.IsHit(food))
            {
                vList.Add(food);
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #21
0
        public bool Eat(Point food)
        {
            Point head = GetNextPoint();

            if (head.IsHit(food))
            {
                food.Symbol = head.Symbol;
                food.Color  = head.Color;
                _PointList.Add(food);
                return(true);
            }

            return(false);
        }
Exemple #22
0
        public bool Eat(Point foodPoint)
        {
            Point headPoint = GetNextPoint();

            if (headPoint.IsHit(foodPoint))
            {
                foodPoint.symbol = headPoint.symbol;
                pointList.Add(foodPoint);
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #23
0
        internal bool Eat(Point food)
        {
            Point head = this.pList.Last();;

            if (head.IsHit(food))
            {
                food.sym = head.sym;
                pList.Add(food);
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #24
0
        public bool Eat(Point food)
        {
            Point head = GetNextPoint();

            if (head.IsHit(food))
            {
                food.symbol = head.symbol;
                pList.Add(food);
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #25
0
        internal bool Eat(Point Food)
        {
            Point head = GetNextPoint();

            if (head.IsHit(Food))
            {
                Food.sym = head.sym;
                pList.Add(Food);
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #26
0
        internal bool BadEat(Point badFood)
        {
            Point head = GetNextPoint();

            if (head.IsHit(badFood))
            {
                badFood.sym = head.sym;
                plist.Add(badFood);
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #27
0
        public bool Eat(Point food)
        {
            Point head = GetNewPoint();

            if (head.IsHit(food))
            {
                food.sign = head.sign;
                dots.Add(food);
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #28
0
        internal bool Eat(Point food)
        {
            Point h = NextPoint();

            if (h.IsHit(food))
            {
                food.c = h.c;
                points.Add(food);
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #29
0
        public bool Eat(Point food)
        {
            Point head = GetNextPoint();

            if (head.IsHit(food))
            {
                food.Sign = head.Sign;
                pointsList.Add(food);
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #30
0
        public bool Eat(Point food)
        {
            Point head = new Point(PList[PList.Count - 1]);

            if (head.IsHit(food))
            {
                food.Sym = head.Sym;
                PList.Add(food);
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #31
0
        internal bool Eat(Point food)
        {
            Point head = GetNextPosition();

            if (head.IsHit(food))
            {
                food.symbol = head.symbol;
                pointList.Add(food);
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #32
0
        internal bool IsHitTale()
        {
            Point head = pList.Last();

            for (int i = 0; i < pList.Count - 2; i++)
            {
                if (head.IsHit(pList[i]))
                {
                    return(true);
                }
            }
            return(false);

            throw new NotImplementedException();
        }