예제 #1
0
        public override void Function()
        {
            if (_text == "Start Game")
            {
                StaticValues.Gamestate = 1;
            }
            else if (_text == "High Scores")
            {
                StaticValues.Gamestate = 6;
                StaticValues.LoadHighscores();
            }
            else if (_text == "Options")
            {
                StaticValues.Gamestate = 5;
            }
            else if (_text == "Back to Main Menu")
            {
                StaticValues.Gamestate = 0;
            }
            else if (_text == "Unpause")
            {
                StaticValues.Gamestate = 1;
            }
            else if (_text == "Quit")
            {
                StaticValues.Close = true;
            }
            else if (_text == "Switch FPS Limit:")
            {
                StaticValues.fpsLimit++;
                if (StaticValues.fpsLimit > (StaticValues.fpsOptions.Length - 1))
                {
                    StaticValues.fpsLimit = 0;
                }
            }
            else if (_text == "Switch Resolution:")
            {
                StaticValues.currentRes++;
                if (StaticValues.currentRes > (StaticValues.res.Count - 1))
                {
                    StaticValues.currentRes = 0;
                }
            }
            else if (_text == "Restart")
            {
                StaticValues.reinit = true;
            }

            base.Function();
        }
예제 #2
0
        public Game()
        {
            graphics = new GraphicsDeviceManager(this);

            graphics.PreferredBackBufferWidth  = 1280;
            graphics.PreferredBackBufferHeight = 720;
            graphics.IsFullScreen = false;

            IsFixedTimeStep = false;
            graphics.SynchronizeWithVerticalRetrace = true;
            graphics.ApplyChanges();

            StaticValues.LoadResolutions();
            StaticValues.LoadHighscores();

            IsMouseVisible = true;

            Content.RootDirectory = "Content";
        }