예제 #1
0
        // This is the Entry Point for the entire Game (the console application)
        private static void Main()
        {
            var gameTitle = new GameTitle()
            {
                // TODO: Come up with a cooler title...
                Title          = "Awesome Title!",
                TitleTextColor = Color.Aqua,

                // TODO: Put your name here...
                Author          = "<Your Name Here!>",
                AuthorTextColor = Color.CadetBlue
            };

            // Helper to pretty up and print the above variable
            GameSetupHandler.DisplayGameTitle(gameTitle);

            // This calls the Interface to { get; } a reference to our Player object we built earlier
            var player = CharacterCreator.Player;

            // Gets the players name from console input
            PlayerSetupHandler.WelcomePlayer(player);

            // User assigns their starting traits
            PlayerSetupHandler.SetPlayerTraits(player);

            // Game ends once 'BeginAdventure' returns
            GameSetupHandler.BeginAdventure(player, RoomCreator.YourBedroom);
        }
예제 #2
0
        // This is the Entry Point for the entire Game (the console application)
        private static void Main()
        {
            // Helper to pretty up and print the above variable
            GameSetupHandler.DisplayGameTitle(GameTitle);

            // If a save file exists, ask to load it
            var gameLoaded = GameSetupHandler.TryLoadGame();

            // This calls the Interface to { get; } a reference to our Player object we built earlier
            var player = CharacterCreator.Player;

            if (!gameLoaded)
            {
                // Gets the players name from console input
                PlayerSetupHandler.WelcomePlayer(player);

                // User assigns their starting traits
                PlayerSetupHandler.SetPlayerTraits(player);

                // Game ends once 'BeginAdventure' returns
                GameSetupHandler.BeginAdventure(player, RoomCreator.YourBedroom);
            }
            else
            {
                // Shortcut the call to TheAdventure so we don't print the gameIntro when we load from save
                var roomToLoad = GameSetupHandler.GetCurrentRoomFromRoomName(CharacterCreator.Player.CurrentRoomName);
                GameSetupHandler.TheAdventure(player, roomToLoad, false);
            }
        }