Ejemplo n.º 1
0
        // PAUSE GAME SCREEN
        public bool PauseGame(WorldController worldController)
        {
            Console.Clear();
            // Scale window size with Terrarium width and height
            Console.SetWindowSize(120, 30);
            // Set buffersize to remove scroll bars from window
            Console.SetBufferSize(120, 30);
            // Print ASCIIART "Terrarium"
            Console.ForegroundColor = ConsoleColor.DarkYellow;
            PrintASCIIArt(2, ASCIIART["pause"]);
            Console.ForegroundColor = ConsoleColor.White;
            printHowTo(14, 10);
            // Print menu buttons
            int selectedItem = Menu.MultipleChoice(32, 21, true, "SAVE GAME", "CONTINUE", "QUIT");

            // Menu actions
            switch (selectedItem)
            {
            case 0:
                GameController.SaveGame();
                return(true);

            case 1:
                return(true);

            default:
                Console.Clear();
                Environment.Exit(0);
                return(false);
            }
        }
Ejemplo n.º 2
0
 public void LoadGame(string path)
 {
     try
     {
         using (var bestand = File.Open(path, FileMode.Open, FileAccess.Read))
         {
             var        lezer = new BinaryFormatter();
             SaveObject Load;
             Load = (SaveObject)lezer.Deserialize(bestand);
             WorldController world = new WorldController(Load.Terrarium, Load.TimeController, Load.TerrariumSettings, true);
             WorldController   = world;
             TerrariumSettings = world.TerrariumSettings;
             WorldController.Start();
         }
     }
     catch (Exception ex)
     {
         ScreenController.GameScreen(new TerrariumSettings(), ex.Message);
     }
 }
Ejemplo n.º 3
0
 public void StartGame()
 {
     ScreenController.LoadScreens(TerrariumSettings);
     WorldController = new WorldController(TerrariumSettings, ScreenController);
     WorldController.Start();
 }