public MyPoint GetNextPoint() { { MyPoint head = pointList.Last(); MyPoint nextPoint = new MyPoint(head); nextPoint.MovePoint(1, Direction); return(nextPoint); } }
public Snake(MyPoint tail, int length, Direction _direction) { Direction = _direction; for (int i = 0; i < length; i++) { MyPoint newPoint = new MyPoint(tail); newPoint.MovePoint(i, Direction); pointList.Add(newPoint); } }
public Snake(MyPoint tail, int length, Color _color, Direction _direction) //added a new propery named class { Direction = _direction; color = _color; for (int i = 0; i < length; i++) { MyPoint newPoint = new MyPoint(tail); newPoint.MovePoint(i, Direction); pointList.Add(newPoint); } }