public Snake(PO tail, int lenght, DN1 direction) { pList = new List <PO>(); for (int i = 0; i < lenght; i++) { PO p = new PO(tail);//\\(ConsoleColor.Red) p.Move(i, direction); pList.Add(p); } }
public void Move(int offset, DN1 direction) { if (direction == DN1.RIGHT) { x = x + offset; } else if (direction == DN1.LEFT) { x = x - offset; } else if (direction == DN1.UP) { y = y - offset; } else if (direction == DN1.DOWN) { y = y - offset; } }