示例#1
0
文件: snake.cs 项目: Ihor01/snake
 point NextPoint()
 {
     point head = pList.Last();
     point NextPoint = new point(head);
     NextPoint.Move(1, Direction);
     return NextPoint;
 }
示例#2
0
文件: snake.cs 项目: Ihor01/snake
 public snake(point pos, int length, direction dir)
 {
     Direction = dir;
     pList = new List<point>();
     for (int i = 0; i < length; i++)
     {
         point p = new point(pos);
         p.Move(i, dir);
         pList.Add(p);
     }
     Draw();
 }
示例#3
0
文件: snake.cs 项目: Ihor01/snake
 public void Teleport(point port)
 {
     var tail = pList.Last();
     pList.Remove(tail);
     tail.Clear();
     var head = new point(port, 3);
     head.Move(1, Direction);
     pList.Add(head);
 }