point NextPoint() { point head = pList.Last(); point NextPoint = new point(head); NextPoint.Move(1, Direction); return NextPoint; }
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(); }
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); }