Пример #1
0
        public MenuState(Game1 aGame, GraphicsDevice aGraphicsDevice, ContentManager aContent, GraphicsDeviceManager aManager) : base(aGame, aGraphicsDevice, aContent)
        {
            myManager     = aManager;
            myButtonFont  = aContent.Load <SpriteFont>("Font");
            myMenuTexture = aContent.Load <Texture2D>("MenuTexture");

            myManager.PreferredBackBufferHeight = 480;
            myManager.PreferredBackBufferWidth  = 800;
            myManager.ApplyChanges();

            myUnlockables = new SaveColors();
            myMap         = new MapEditor();
            myCustom      = new CustomizeState(aGame, aGraphicsDevice, aContent);
            mySkillTree   = new SkillTree();

            myStrings = new List <string>()
            {
                "Start Game",
                "Customize",
                "Skill Tree",
                "Quit Game",
            };
            myPositions = new List <Vector2>()
            {
                new Vector2(325, 90),
                new Vector2(325, 190),
                new Vector2(325, 290),
                new Vector2(325, 390),
                new Vector2(325, 490),
            };
        }
Пример #2
0
        void Selection()
        {
            KeyboardState tempKeys = Keyboard.GetState();

            if (tempKeys.IsKeyDown(Keys.Enter) && myPrevState.IsKeyUp(Keys.Enter))
            {
                if (mySelected == 0)
                {
                    myGame.ChangeState(new GameState(myGame, myGraphDevice, myContentManager, myManager));
                }
                if (mySelected == 1)
                {
                    myGame.ChangeState(new CustomizeState(myGame, myGraphDevice, myContentManager));
                }
                if (mySelected == 2)
                {
                    myGame.ChangeState(new SkillTreeState(myGame, myGraphDevice, myContentManager));
                }
                if (mySelected == 3)
                {
                    SaveColors.End();
                    MapEditor.End();
                    SkillTree.Update();
                    myGame.Exit();
                }
            }
            myPrevState = tempKeys;
        }
Пример #3
0
 private void MyQuitButton_Click(object sender, EventArgs e)
 {
     SaveColors.End();
     MapEditor.End();
     SkillTree.Update();
     myGame.Exit();
 }