コード例 #1
0
        public SettingsScreen(PlayerSelect prevScreen)
        {
            this.prevScreen = prevScreen;
            upPressed = true;
            downPressed = true;
            leftPressed = true;
            rightPressed = true;
            startPressed = true;
            enterPressed = true;

            gravity = 9.8f;
            timeLimit = prevScreen.Mode == 2 ? 2 : 0;
            lives = 3;

            selectedMap = 0;

            maps = new List<Texture2D>();
            maps.Add(MainGame.tex_bg_castle);
            maps.Add(MainGame.tex_bg_pillar);
            maps.Add(MainGame.tex_bg_octopus);
            //			maps.Add(MainGame.tex_bg_graveyard);
            //			maps.Add(MainGame.tex_bg_clocktower);
            maps.Add(MainGame.tex_bg_circus);

            checkValues = new Dictionary<string, bool>();
            components = new List<Component>();
            components.Add(new Button(new Vector2(1190, 235), MainGame.tex_btnUp, "map"));
            components.Add(new Button(new Vector2(1190, 315), MainGame.tex_btnUp, "grav"));
            components.Add(new Button(new Vector2(1190, 395), MainGame.tex_btnUp, "time"));
            components.Add(new Button(new Vector2(1190, 475), MainGame.tex_btnUp, "lives"));
            components.Add(new CheckBox(new Vector2(800, 555), "Sudden death mode", "death"));
            checkValues.Add("death", false);
            components.Add(new CheckBox(new Vector2(800, 635), "Allow ranged attacks", "ranged"));
            checkValues.Add("ranged", false);
            components.Add(new CheckBox(new Vector2(800, 715), "Allow mines", "traps"));
            checkValues.Add("traps", false);
            if (prevScreen.Mode != -1)
            {
                components.Add(new CheckBox(new Vector2(800, 795), "Fill empty slots with bots", "bots"));
                checkValues.Add("bots", false);
            }
            components.Add(new Button(new Vector2(960, 940), MainGame.tex_ps_next, "start"));
            components[components.Count - 1].Selected = true;

            ((CheckBox)components[5]).Checked = true;
            checkValues["ranged"] = true;
            ((CheckBox)components[6]).Checked = true;
            checkValues["traps"] = true;
            if (prevScreen.Mode != -1)
            {
                checkValues["bots"] = true;
                ((CheckBox)components[7]).Checked = true;
            }

            selectedComponent = components.Count - 1;
        }
コード例 #2
0
        public SettingsScreen(PlayerSelect prevScreen)
        {
            this.prevScreen = prevScreen;
            upPressed = true;
            downPressed = true;
            leftPressed = true;
            rightPressed = true;
            startPressed = true;
            enterPressed = true;

            gravity = 9.8f;
            limbStrength = 1f;
            timeLimit = 0;
            lives = 5;

            selectedComponent = 0;
            selectedMap = 0;

            maps = new List<Texture2D>();
            maps.Add(MainGame.tex_bg_castle);

            checkValues = new Dictionary<string, bool>();
            components = new List<Component>();
            components.Add(new Button(new Vector2(1160, 235), MainGame.tex_btnUp, "map"));
            components.Add(new Button(new Vector2(1160, 315), MainGame.tex_btnUp, "grav"));
            components.Add(new Button(new Vector2(1160, 395), MainGame.tex_btnUp, "limb"));
            components.Add(new Button(new Vector2(1160, 475), MainGame.tex_btnUp, "time"));
            components.Add(new Button(new Vector2(1160, 555), MainGame.tex_btnUp, "lives"));
            components.Add(new CheckBox(new Vector2(800, 635), "Sudden death mode", "death"));
            checkValues.Add("death", false);
            components.Add(new CheckBox(new Vector2(800, 715), "Allow ranged attacks", "ranged"));
            checkValues.Add("ranged", false);
            components.Add(new CheckBox(new Vector2(800, 795), "Allow mines", "traps"));
            checkValues.Add("traps", false);
            components.Add(new CheckBox(new Vector2(800, 875), "Fill empty slots with bots", "bots"));
            checkValues.Add("bots", false);
            components.Add(new Button(new Vector2(960, 980), MainGame.tex_ps_next, "start"));
            components[0].Selected = true;

            ((CheckBox)components[6]).Checked = true;
            checkValues["ranged"] = true;
            ((CheckBox)components[7]).Checked = true;
            checkValues["traps"] = true;
            if (prevScreen.Colors.Length == 1)
            {
                checkValues["bots"] = true;
                ((CheckBox)components[8]).Checked = true;
            }
        }