Esempio n. 1
0
 private void UpdateMainMenu()
 {
     if (MainMenuManager.CheckNewGame())
     {
         ChangeGameState(GameState.CharacterCreationMenu);
     }
     if (MainMenuManager.CheckLoadGame())
     {
         LoadSave();
     }
     if (MainMenuManager.CheckExitGame())
     {
         Exit();
     }
 }
Esempio n. 2
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

            TextureManager.LoadContent(Content);
            ItemCreator.LoadItemData();
            SoundManager.LoadSounds(Content);
            SoundManager.PlayMusic();
            SoundManager.PlayPauseMusic();
            AchievementManager.CreateAchievements();
            Player.Init();
            MainMenuManager.Init();
            OptionsMenu.Init();
            CityManager.Initialize();
            TravelMenu.Init();
            WorldEventManager.Init();
            EventLog.Init();
            WorldMapMenu.LoadCities();
            EncounterManager.Initialize();
            CityInfoMenu.Init();
            CharCreationMenu.Init();
            SkillManager.Init();

            ModifierManager.LoadCityAndCategoryLists();
            ModifierManager.LoadItemModifiers();
            Calendar.PrepareCalendar();

            cityMenu = new CityMenu();
            playerInventoryModule = new PlayerInventoryModule();

            previousGameState2 = GameState.Debug;
            previousGameState  = GameState.Debug;
            gameState          = GameState.MainMenu;

            options   = false;
            activeInv = new Inventory(100);
            random    = new Random();

            CityControlList = new List <string>();
            CityControlList.Add("Carrot Town");
            CityControlList.Add("Cloudspire");
        }
Esempio n. 3
0
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);

            spriteBatch.Begin();

            if (gameState != GameState.MainMenu && !TravelMenu.travelling)
            {
                DrawBackground(spriteBatch);
            }


            if (gameState == GameState.CityMenu)
            {
                cityMenu.Draw(spriteBatch, WorldMapMenu.Cities);
            }
            else if (gameState == GameState.MapMenu)
            {
                WorldMapMenu.Draw(spriteBatch);
            }
            else if (gameState == GameState.TradeMenu)
            {
                Trading.Draw(spriteBatch);
            }
            else if (gameState == GameState.InventoryMenu)
            {
                playerInventoryModule.Draw(spriteBatch);
            }
            else if (gameState == GameState.TravelMenu)
            {
                TravelMenu.Draw(spriteBatch);
            }
            else if (gameState == GameState.MainMenu)
            {
                MainMenuManager.Draw(spriteBatch);
            }
            else if (gameState == GameState.CharacterCreationMenu)
            {
                CharCreationMenu.Draw(spriteBatch);
            }
            else if (gameState == GameState.Debug)
            {
                spriteBatch.DrawString(TextureManager.font32, "Press F1 for City Menu, F2 for Map Menu, F3 for Inv. Menu,\nF4 for Trading Menu or F5 for Travelling Menu \nand you can always press F6 to return here\nF11 loads and F12 saves", new Vector2(200, 200), Color.White);
            }
            if (gameState != GameState.MainMenu && gameState != GameState.InventoryMenu)
            {
                Calendar.Draw(spriteBatch);
            }

            CityInfoMenu.Draw(spriteBatch);

            if (eventLog)
            {
                EventLog.Draw(spriteBatch);
            }

            OptionsMenu.Draw(spriteBatch, options);

            EndCredits.Draw(spriteBatch); //////////////////////////////
            LevelUp.Draw(spriteBatch);    /////////////////////////////////
            spriteBatch.End();

            //Window.Title = "Press F6 for debug menu          " + Player.SkillLevels[0].ToString() + Player.SkillLevels[1].ToString() + Player.SkillLevels[2].ToString() + "    " + OptionsMenu.selectedSkill;
            Window.Title = "Project Travelling Merchant";
            //if (test)
            //{
            //    Window.Title = "WAAAAR";
            //}


            base.Draw(gameTime);
        }