static void Main(string[] args) { Console.OutputEncoding = Encoding.UTF8; Thread thread = new Thread(SetTimer); thread.Priority = ThreadPriority.Lowest; thread.Start(); Console.WriteLine("The application started at {0:HH:mm:ss.fff}", DateTime.Now); Console.WriteLine("Press key: agree - A, ignore - I "); PressKeyA(); Tamagtchi tamagtchi = new Tamagtchi(); tamagtchi.LifeTama(); aTimer.Stop(); aTimer.Dispose(); Console.ReadKey(); }
public void LifeTama() { Menu: if (ignore == 0) { Console.WriteLine("Game end!!!!!!!!!!"); //System.Environment.Exit(5); return; } rnd = new Random(); int x = rnd.Next(1, 6); { switch (x) { case 1: Console.WriteLine(new string(' ', 10) + "Покорми меня"); s = char.Parse(Console.ReadLine()); if (GetChar(s)) { ignore--; } Tamagtchi.refrenSolo(); Tamagtchi.coupleSolo(); goto Menu; case 2: Console.WriteLine(new string(' ', 10) + "Погулять"); s = char.Parse(Console.ReadLine()); if (GetChar(s)) { ignore--; } Tamagtchi.Grasshoper(); goto Menu; case 3: Console.WriteLine(new string(' ', 10) + "Уложить спать"); s = char.Parse(Console.ReadLine()); if (GetChar(s)) { ignore--; } goto Menu; case 4: Console.WriteLine(new string(' ', 10) + "Полечить"); s = char.Parse(Console.ReadLine()); if (GetChar(s)) { ignore--; } goto Menu; case 5: Console.WriteLine(new string(' ', 10) + "Поиграть"); s = char.Parse(Console.ReadLine()); if (GetChar(s)) { ignore--; } goto Menu; } } while (ignore != 0) { ; } }