Beispiel #1
0
        public bool TouchBounds(ushort min_xbound, ushort max_xbound, ushort min_ybound, ushort max_ybound)
        {
            Point head = plist.Last();

            if (head.CheckHit(new Point(min_xbound, min_ybound), "xory") || head.CheckHit(new Point(max_xbound, max_ybound), "xory"))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #2
0
        public bool TouchSelf()
        {
            Point head = plist.Last();

            for (ushort n = 0; n < plist.Count - 4; n++)
            {
                if (head.CheckHit((plist[n]), "xy"))
                {
                    return(true);
                }
            }
            return(false);
        }
Beispiel #3
0
        internal bool Eat(Food food)
        {
            Point head = GenNextPoint();

            if (head.CheckHit(food, "xy"))
            {
                Point nosh = new Point(food);
                nosh.CopyParameter(head, "s");
                plist.Add(nosh);
                nosh.Draw(color);
                return(true);
            }
            else
            {
                return(false);
            }
        }