Ejemplo n.º 1
0
        public static void Move()
        {
            PointConsole tempPoint = BodyPoints.First();

            if (Direct == Direction.Up)
            {
                tempPoint = new PointConsole(tempPoint.X, tempPoint.Y - 1);
            }
            if (Direct == Direction.Down)
            {
                tempPoint = new PointConsole(tempPoint.X, tempPoint.Y + 1);
            }
            if (Direct == Direction.Left)
            {
                tempPoint = new PointConsole(tempPoint.X - 1, tempPoint.Y);
            }
            if (Direct == Direction.Right)
            {
                tempPoint = new PointConsole(tempPoint.X + 1, tempPoint.Y);
            }

            BodyPoints.Insert(0, tempPoint);
            new PointConsole(BodyPoints.Last().X, BodyPoints.Last().Y).DrawPoint(' ');
            BodyPoints.Remove(BodyPoints.Last());
            DrawSnake();
        }
Ejemplo n.º 2
0
 public static void Rise()
 {
     BodyPoints.Add(BodyPoints.Last());
 }