示例#1
0
        public Player(ContentManager content)
        {
            mapManager = new MapManager(content);
            _map = mapManager.CreateMap(Global.LEVEL);
            towerButtons = Data.loadTowerButton(content);
            waveManager = Data.loadWave(Global.LEVEL);
            SetUpPanel(content);
            coin_tex = content.Load<Texture2D>(@"Sprite\Image\coin");
            coin = new NormalSprite(coin_tex, 0, 0, coin_tex.Width, coin_tex.Height);

            speed_1_tex = content.Load<Texture2D>(@"Sprite\Image\Menu\button_x1");
            NormalSprite speed_1 = new NormalSprite(speed_1_tex, 685, 5, speed_1_tex.Width / 2, speed_1_tex.Height);
            increaseSpeed_1 = new Checkbox(speed_1, 2, Global.NEW_GAME_SPEED == 1 ? true : false);
            speedButtonList.Add(increaseSpeed_1);

            skip_tex = content.Load<Texture2D>(@"Sprite\Image\Menu\button_skip");
            NormalSprite speed_2 = new NormalSprite(skip_tex, 720, 5, skip_tex.Width / 2, skip_tex.Height);
            increaseSpeed_2 = new Checkbox(speed_2, 2, Global.NEW_GAME_SPEED == 2 ? true : false);
            speedButtonList.Add(increaseSpeed_2);

            speed_3_tex = content.Load<Texture2D>(@"Sprite\Image\Menu\button_x3");
            NormalSprite speed_3 = new NormalSprite(speed_3_tex, 755, 5, speed_3_tex.Width / 2, speed_3_tex.Height);
            increaseSpeed_3 = new Checkbox(speed_3, 2, Global.NEW_GAME_SPEED == 3 ? true : false);
            speedButtonList.Add(increaseSpeed_3);

            _content = content;
        }
示例#2
0
        private void createOptionScreen(string panel_file)
        {
            Data.loadConfig();
            Texture2D texture = Content.Load<Texture2D>(panel_file);
            _optionPanel = new NormalSprite(texture, 250, 150, texture.Width, texture.Height);

            Texture2D checkbox_tex = Content.Load<Texture2D>(@"Sprite\Image\Menu\checkbox");

            NormalSprite checkbox_sound = new NormalSprite(checkbox_tex, 458, 230, checkbox_tex.Width / 2, checkbox_tex.Height);
            button_sound = new Checkbox(checkbox_sound, 2, Global.SOUNDEFFECT_ENABLE);

            NormalSprite checkbox_music = new NormalSprite(checkbox_tex, 458, 270, checkbox_tex.Width / 2, checkbox_tex.Height);
            button_music = new Checkbox(checkbox_music, 2, Global.MUSIC_ENABLE);

            Texture2D okButton_tex = Content.Load<Texture2D>(@"Sprite\Image\Menu\ok");
            NormalSprite okButton = new NormalSprite(okButton_tex, 340, 325, okButton_tex.Width / 2, okButton_tex.Height);
            button_ok = new MenuButton(okButton, 2, 3, 0, 0);
        }