示例#1
0
        public Point CreateFood(MapObjectsList mapObjectsList)
        {
            int   x, y;
            Point p;

            do
            {
                x = random.Next(2, mapObjectsList.mapWidht - 2);
                y = random.Next(2, mapObjectsList.mapHeight - 2);
                p = new Point(x, y, sym);
            } while (mapObjectsList.isHit(p));
            return(p);
        }
示例#2
0
        public bool Move(MapObjectsList fList)
        {
            Point tail = pList.First();

            pList.Remove(tail);
            Point head = GenNextPoint();

            if (fList.isHit(head))
            {
                return(false);
            }
            pList.Add(head);
            tail.Clear();
            head.Draw();
            return(true);
        }