예제 #1
0
파일: Snake.cs 프로젝트: lihac92/snake
        public Point1 GetNextPoint()
        {
            Point1 head      = pList.Last();
            Point1 nextPoint = new Point1(head);

            nextPoint.Move(1, direction);
            return(nextPoint);
        }
예제 #2
0
파일: Snake.cs 프로젝트: lihac92/snake
 public Snake(Point1 tail, int length, Direction _direction)
 {
     direction = _direction;
     pList     = new List <Point1>();
     for (int i = 0; i < length; i++)
     {
         Point1 p = new Point1(tail);
         p.Move(i, direction);
         pList.Add(p);
     }
 }