Пример #1
0
        public MatchOptions()
        {
            int[] p = new int[10];

            for (int i = 0; i < p.Length; i++)
            {
                p[i] = i * 5 + 5;
            }

            points = new SelectableInt(p, "Maximum Points");

            Texture2D mapOne, mapTwo, mapThree;

            mapOne   = GameStateManager.Instance.Content.Load <Texture2D>("Images/pingMenü");
            mapTwo   = GameStateManager.Instance.Content.Load <Texture2D>("Images/humMenü");
            mapThree = GameStateManager.Instance.Content.Load <Texture2D>("Images/delMenü2");

            stages = new SelectableImage(new[] { mapOne, mapTwo, mapThree }, "Maps");

            wind       = new SelectableBool("Wind");
            enemyVelo  = new SelectableBool("Velocity Drops");
            ballRadius = new SelectableBool("Ball Radius Drops");

            options    = new SelectableOptions[5];
            options[0] = stages;
            options[1] = points;
            options[2] = wind;
            options[3] = enemyVelo;
            options[4] = ballRadius;

            active = 0;
            options[active].Active = true;

            back      = new Image();
            back.Path = "Images/buttonTexture";
            back.Text = "Back";
            back.LoadContent();
            back.Position = new Vector2(60, GameStateManager.Instance.dimensions.Y - back.SourceRect.Height - 60);

            play      = new Image();
            play.Path = "Images/buttonTexture";
            play.Text = "Play";
            play.LoadContent();
            play.Position = new Vector2(GameStateManager.Instance.dimensions.X - play.SourceRect.Width - 60, GameStateManager.Instance.dimensions.Y - play.SourceRect.Height - 60);
        }
Пример #2
0
        public Settings()
        {
            background      = new Image();
            background.Path = "Images/TitleScreen";
            background.LoadContent();
            background.Scale = new Vector2((float)GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width / ((float)background.Texture.Width / 1.5f),
                                           (float)GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height / ((float)background.Texture.Height / 1.5f));
            background.Position = new Vector2(0, 0);

            bg       = new Image();
            bg.Path  = "Textures/Black";
            bg.Alpha = 0.3f;
            bg.LoadContent();
            bg.Scale = new Vector2((float)GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width / ((float)background.Texture.Width / 1.5f),
                                   (float)GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height / ((float)background.Texture.Height / 1.5f));
            bg.Position = new Vector2(GameStateManager.Instance.dimensions.X / 2, 0);

            int[] sound = new int[21];
            for (int i = 0; i < 21; i++)
            {
                sound[i] = 5 * i;
            }

            ingame     = new SelectableInt(sound, "Ingame Volume");
            music      = new SelectableInt(sound, "Music Volume");
            fullscreen = new SelectableBool("Fullscreen");

            for (int i = 0; i < 21; i++)
            {
                if (sound[i] == GameStateManager.Instance.MusicVolume)
                {
                    music.active = i;
                }

                if (sound[i] == GameStateManager.Instance.IngameVolume)
                {
                    ingame.active = i;
                }
            }

            if (GameStateManager.Instance.Fullscreen)
            {
                fullscreen.active = 1;
            }
            else
            {
                fullscreen.active = 0;
            }

            options    = new SelectableOptions[3];
            options[0] = ingame;
            options[1] = music;
            options[2] = fullscreen;

            active = 0;
            options[active].Active = true;

            save      = new Image();
            save.Path = "Images/buttonTexture";
            save.Text = "Save & Back";
            save.LoadContent();
            save.Position = new Vector2(100, GameStateManager.Instance.dimensions.Y / 2 + 200);
        }