internal void MoveHero() { Point tailPoint = pointList.First(); // return first list element pointList.Remove(tailPoint); // delete last point it snake Point headPoint = GetNextPoint(); pointList.Add(headPoint); tailPoint.ClearPoint(); headPoint.DrawPoint(); }
internal void Move() { Point tail = pList.First(); pList.Remove(tail); Point head = GetNextPoint(); pList.Add(head); tail.ClearPoint(); head.DrawPoint(); if (direction == Direction.Up || direction == Direction.Down) { Thread.Sleep(speedVertical); } else { Thread.Sleep(speedHorizontal); } }