Exemplo n.º 1
0
        public override void LoadContent()
        {
            base.LoadContent();

            _content = new ContentManager(ScreenManager.Instance.Content.ServiceProvider, "Content");

            XmlManager<Player> playerLoader = new XmlManager<Player>();
            _player = playerLoader.Load("Content/Data/Gameplay/Player.xml");
            _player.LoadContent();

            _alterverse = new Alterverse(OnAlternativeChange);
            _alterverse.LoadContent();

            _levelView = new LevelView(_alterverse.CurrentLevel);
            _levelView.LoadContent();

            _alterIcons = new List<AlternativeIcon>();
            AlternativeIcon altIcon = new AlternativeIcon(new Vector2(100, 50), "1");
            altIcon.LoadContent();
            altIcon.IsActive = true;
            _alterIcons.Add(altIcon);

            //XmlManager<Map> mapLoader = new XmlManager<Map>();
            //_map = mapLoader.Load("Load/Gameplay/Maps/Map1.xml");
            //_map.LoadContent();

            _mouseState = Mouse.GetState();

            _accessedTiles = new List<Tile>();
        }
Exemplo n.º 2
0
        private void OnAlternativeChange(Level level)
        {
            _levelView.ChangeAlternative(level);
            _player.ActivateGravity = true;

            if(_alterverse.CurrentAlternative > _alterIcons.Count-1)
            {
                AlternativeIcon newAltIcon = new AlternativeIcon(_alterIcons[_alterIcons.Count - 1].Position + new Vector2(100, 0),
                    (_alterverse.CurrentAlternative+1).ToString());
                newAltIcon.LoadContent();
                _alterIcons.Add(newAltIcon);
            }

            foreach(AlternativeIcon alterIcon in _alterIcons)
            {
                alterIcon.IsActive = false;
            }

            _alterIcons[_alterverse.CurrentAlternative].IsActive = true;
        }