Example #1
0
        /// <summary>
        /// load content
        /// </summary>
        public override void LoadContent()
        {
            Pausable = true;

            ScreenManager.LightingEnabled = true;


            LevelData levelData = LevelData.Load();

            levelGroup = new LevelGroup(levelData.GroupIndex, levelData.LevelIndex);
            levelGroup.LoadLevel();
            levelData.LastScreen = ScreenOrder.ScreenToId(this);
            levelData.Save();

            //load music depending on the group
            switch (levelGroup.GroupIndex)
            {
            case 0:
                SoundManager.PlaySong("Group_1", true);
                break;

            case 1:
                SoundManager.PlaySong("Group_2", true);
                break;

            case 2:
                SoundManager.PlaySong("Group_3", true);
                break;
            }


            base.LoadContent();
        }
Example #2
0
        /// <summary>
        /// load all boss content
        /// </summary>
        public override void LoadContent()
        {
            Pausable = true;

            SoundManager.PlaySong("Boss_Song", true);

            levelData            = LevelData.Load();
            levelData.LastScreen = ScreenOrder.ScreenToId(this);
            levelData.GroupIndex = 1;
            levelData.LevelIndex = 0;
            levelData.Save();

            dbox = new DialogueBox("Scripts/boss1Script.txt");
            dbox.LoadDBox();
            dbox.IsActive = true;

            level = new Level("Levels/boss1.bmp");
            level.LoadLevel();
            level.CamType = "static";

            bossAnim           = new Animation(ImageTools.LoadTexture2D("Characters/Bosses/boss1"), 40, true);
            bossAnim.FrameTime = .15f;
            boss = new Boss(8);
            boss.BoundingRect = new Rectangle(17 * Tile.Size, 960 - (6 * 32), bossAnim.Width, bossAnim.Height);

            LoadProjectiles();

            background = new ParallaxBackground(ImageTools.LoadTexture2D("Graphics/Backgrounds/cave_level_1_background"),
                                                ImageTools.LoadTexture2D("Graphics/Backgrounds/cave_level_1_bottom_parallax"),
                                                ImageTools.LoadTexture2D("Graphics/Backgrounds/cave_level_1_top_parallax"));

            base.LoadContent();
        }
Example #3
0
        /// <summary>
        /// update game logic
        /// </summary>
        /// <param name="gameTime"></param>
        public override void Update(GameTime gameTime)
        {
            startButton.Update();
            optionsButton.Update();
            creditsButton.Update();
            exitButton.Update();
            resetButton.Update();

            if (startButton.Clicked)
            {
                ScreenManager.ChangeScreens(this, ScreenOrder.IdToScreen(LevelData.Load().LastScreen));
            }
            if (optionsButton.Clicked)
            {
                optionsButton.Clicked = false;
                ScreenManager.AddScreen(new SettingsScreen());
            }
            if (creditsButton.Clicked)
            {
                ScreenManager.ChangeScreens(this, new CreditsScreen());
            }
            if (exitButton.Clicked)
            {
                ScreenManager.ExitGame = true;
            }

            if (resetButton.Clicked)
            {
                LevelData levelData = LevelData.Load();
                levelData.LastScreen = ScreenOrder.ScreenToId(new PrologueScreen());
                levelData.GroupIndex = 0;
                levelData.LevelIndex = 0;
                levelData.Save();

                PlayerData playerData = PlayerData.Load();
                playerData.Health    = 5;
                playerData.FlaskUses = 3;
                playerData.Save();

                resetButton.Clicked = false;
            }

            base.Update(gameTime);
        }
Example #4
0
        /// <summary>
        /// load screen content
        /// </summary>
        public override void LoadContent()
        {
            Pausable = true;

            SoundManager.PlaySong("Group_2_boss", true);

            //save current screen and data for next level
            levelData            = LevelData.Load();
            levelData.LastScreen = ScreenOrder.ScreenToId(this);
            levelData.GroupIndex = 2;
            levelData.LevelIndex = 0;
            levelData.Save();



            level            = new Level("Levels/boss2.bmp");
            level.TileSetRow = 1;
            level.LoadLevel();
            level.CamType = "shadow";

            boss             = new Boss(1);
            bossCam          = new ShadowCamera(level);
            bossCam.CamSpeed = -2.5f;
            bossCam.Enabled  = true;
            wallBoss         = ImageTools.LoadTexture2D("Characters/Bosses/shadow_wall_boss");

            LoadEyes();

            //load projectiles
            boss.Projectiles.Add(new ShadowBall(level.Player, new Vector2(-8, 0), new Vector2(1280, 192)));
            boss.Projectiles.Add(new ShadowBall(level.Player, new Vector2(-8, 0), new Vector2(1280, 192 * 2)));
            boss.Projectiles.Add(new ShadowBall(level.Player, new Vector2(-8, 0), new Vector2(1280, 192 * 3)));
            boss.Projectiles.Add(new ShadowBall(level.Player, new Vector2(-8, 0), new Vector2(1280, 192 * 4)));

            background = new ParallaxBackground(ImageTools.LoadTexture2D("Graphics/Backgrounds/cave_level_2_background"),
                                                ImageTools.LoadTexture2D("Graphics/Backgrounds/cave_level_2_bottom_parallax"),
                                                ImageTools.LoadTexture2D("Graphics/Backgrounds/cave_level_2_top_parallax"));

            dbox = new DialogueBox("Scripts/boss2Script.txt");
            dbox.LoadDBox();
            dbox.IsActive = true;

            base.LoadContent();
        }
Example #5
0
        /// <summary>
        /// update game logic
        /// </summary>
        /// <param name="gameTime"></param>
        public override void Update(GameTime gameTime)
        {
            levelGroup.Update(gameTime);

            //choose what boss level to load once the level group is done
            if (levelGroup.GroupDone)
            {
                switch (levelGroup.GroupIndex)
                {
                case 0:
                    ScreenManager.ChangeScreens(this, new Boss1Screen());
                    break;

                case 1:
                    ScreenManager.ChangeScreens(this, new Boss2Screen());
                    break;

                case 2:
                    ScreenManager.ChangeScreens(this, new EndBossScreen());
                    break;
                }
            }



            //if the player has died
            if (levelGroup.Player.IsDead || levelGroup.Player.Position.Y > 1000)
            {
                //save all current level data
                LevelData levelData = LevelData.Load();
                levelData.GroupIndex = levelGroup.GroupIndex;
                levelData.LevelIndex = levelGroup.LevelIndex;
                levelData.LastScreen = ScreenOrder.ScreenToId(this);

                //load death screen
                ScreenManager.ChangeScreens(this, new DeathScreen());
            }

            base.Update(gameTime);
        }