Beispiel #1
0
        static void ResetSave(ref BestiaryList BList, ref HighscoresList HSList, ref Equipment Equip)
        {
            StreamWriter SW = new StreamWriter(@"Save Files\Bestiary.txt");

            SW.Close();
            SW = new StreamWriter(@"Save Files\Highscores.txt");
            SW.Close();
            SW = new StreamWriter(@"Save Files\Equipment.txt");
            SW.WriteLine("0");
            SW.WriteLine("1");
            SW.WriteLine("1");
            SW.WriteLine("1");
            SW.WriteLine("false");
            SW.WriteLine("false");
            SW.Close();
            Equip  = new Equipment();
            BList  = new BestiaryList();
            HSList = new HighscoresList();
        }
Beispiel #2
0
        static void NewGame(ref HighscoresList HSList, ref BestiaryList BList, ref Equipment Equip)//, SoundPlayer Music)
        {
            int  Option  = 1;
            bool Picking = true;

            while (Picking)
            {
                LoadNewGame(Option);
                ConsoleKeyInfo Key = Console.ReadKey();
                if (Key.Key == ConsoleKey.UpArrow)
                {
                    if (Option == 1)
                    {
                        Option = 5;
                    }
                    else
                    {
                        Option--;
                    }
                }
                else if (Key.Key == ConsoleKey.DownArrow)
                {
                    if (Option == 5)
                    {
                        Option = 1;
                    }
                    else
                    {
                        Option++;
                    }
                }
                else if (Key.Key == ConsoleKey.Enter)
                {
                    switch (Option)
                    {
                    case 1:
                    {
                        //Music.Stop();
                        Game Game1 = new Game(BList, null, Equip, 1);
                        //Music.PlayLooping();
                        break;
                    }

                    case 2:
                    {
                        UpgradeScreen(Equip);
                        break;
                    }

                    case 3:
                    {
                        //Music.Stop();
                        Game Game1 = new Game(BList, HSList, Equip, 2);
                        //Music.PlayLooping();
                        break;
                    }

                    case 4:
                    {
                        ResetSave(ref BList, ref HSList, ref Equip);
                        break;
                    }

                    default:
                    {
                        Picking = false;
                        break;
                    }
                    }
                }
            }
        }
Beispiel #3
0
 static void Quit(HighscoresList HSList, BestiaryList BList, Equipment Equip)
 {
     HSList.Quit();
     BList.Quit();
     Equip.Quit();
 }
Beispiel #4
0
        static void Main(string[] args)
        {
            Console.OutputEncoding = Encoding.Unicode;
            int            Option = 1;
            ConsoleKeyInfo Key;
            bool           Running = true;
            HighscoresList HSList  = new HighscoresList();
            BestiaryList   BList   = new BestiaryList();
            Equipment      Equip   = new Equipment();

            //SoundPlayer Music = new SoundPlayer(@"Music\Menu.wav");
            //Music.PlayLooping();
            while (Running)
            {
                LoadMenu(Option);
                Key = Console.ReadKey();
                if (Key.Key == ConsoleKey.UpArrow)
                {
                    if (Option == 1)
                    {
                        Option = 5;
                    }
                    else
                    {
                        Option--;
                    }
                }
                else if (Key.Key == ConsoleKey.DownArrow)
                {
                    if (Option == 5)
                    {
                        Option = 1;
                    }
                    else
                    {
                        Option++;
                    }
                }
                else if (Key.Key == ConsoleKey.Enter)
                {
                    switch (Option)
                    {
                    case 1:
                    {
                        NewGame(ref HSList, ref BList, ref Equip);        //, Music);
                        break;
                    }

                    case 2:
                    {
                        HSList.DisplayHighscores();
                        break;
                    }

                    case 3:
                    {
                        LoadBestiary(BList);
                        break;
                    }

                    case 4:
                    {
                        DisplayHelp();
                        break;
                    }

                    default:
                    {
                        Quit(HSList, BList, Equip);
                        Running = false;
                        break;
                    }
                    }
                }
                else if (Key.Key == ConsoleKey.Escape)
                {
                    Quit(HSList, BList, Equip);
                    Running = false;
                }
            }
        }