Example #1
0
        public static void loadLevel(int levelNumber)
        {
            EnemyManager.clear();
            PickUpManager.clear();
            if (levelNumber != m_LevelNumber)
            {
                m_LevelNumber = levelNumber;
            }
            //TODO: call enemy manager clear
            BackgroundMusic.playSong(levelNumber, 0.30f);
            string level = "Content/Level" + levelNumber + ".txt";

            parseData(level);
            if (levelNumber >= 3)
            {
                Background.loadContent(Content, 3, 1);
            }
            else
            {
                Background.loadContent(Content, levelNumber + 1, 1);
            }
            if (levelNumber == 3)
            {
                Boss.IsActive = true;;
            }
            Player.reset();
            Player.setInitialPosition();
            EnemyManager.loadContent(Content);
            GateManager.reset();
            GateManager.loadContent(Content);
            PickUpManager.loadContent(Content);
        }
Example #2
0
        public override void  update(GameTime gameTime)
        {
            base.update(gameTime);

            if (CollisionCheck.collisionCheck(Player.collisionRectangle(), Destination))
            {
                if (Player.m_hasKey == true)
                {
                    Player.m_hasKey = false;
                    m_ScreenManager.CurrentGameState = GameState.LevelComplete;
                    Player.reset();
                    Player.setInitialPosition();
                    Level.levelIncrement();
                }
            }
        }