//detect point collect bool Pointget() { if (px == logx[length] && py == logy[length]) { genpoint(); length++; Console.SetCursorPosition(0, 0); Console.Write(" "); Console.SetCursorPosition(0, 0); Console.Write("Points: " + length); Console.SetCursorPosition(logx[0], logy[0]); snd.Sound("point"); return(false); } else { return(true); } }
public bool Main() { Render rnd = new Render(); int selected; Random random = new Random(); Sounds snd = new Sounds(); bool win; snd.Music(random.Next(1, 5)); do { rnd.Menu(skalkamode); } while(!int.TryParse(Convert.ToString(Console.ReadKey(false).KeyChar), out selected)); switch (selected) { case 0: { return(false); } case 1: { Game game = new Game(border, body, point, space, delay, shortdelay); Console.Clear(); snd.Stop(); win = game.Start(skalkamode); if (win) { snd.Sound("win"); rnd.Win(); Thread.Sleep(2000); } else { snd.Sound("win"); rnd.Gameover(); Thread.Sleep(2000); } Console.Clear(); break; } case 2: { Console.Clear(); Console.SetCursorPosition(0, 0); Console.Write("Work in progress (press any key)"); Console.ReadKey(); break; } case 3: { Console.Clear(); Console.SetCursorPosition(0, 0); Console.Write("Move by arrows (double tab dirrectio for sprint). /nYou can pause game by draging mouse over the game area. /nIf you go to border, yourself or backwards, you gona die."); Console.ReadKey(); break; } } return(true); }