Ejemplo n.º 1
0
        static void Move()
        {
            Shar shar = new Shar();

            shar.Load();
            while (true)
            {
                for (int i = 1; i <= 90; i++)
                {
                    Console.Clear();
                    foreach (Point p in shar.body)
                    {
                        p.x++;
                    }
                    Draw(shar);
                    Thread.Sleep(50);
                }

                for (int i = 90; i >= 1; i--)
                {
                    Console.Clear();
                    foreach (Point p in shar.body)
                    {
                        p.x--;
                    }
                    Draw(shar);
                    Thread.Sleep(50);
                }
            }
        }
Ejemplo n.º 2
0
 static void Draw(Shar shar)
 {
     Console.ForegroundColor = ConsoleColor.Magenta;
     foreach (Point p in shar.body)
     {
         Console.SetCursorPosition(p.x, p.y);
         Console.Write('*');
     }
 }