Exemplo n.º 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();
        }
Exemplo n.º 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();
        }
Exemplo n.º 3
0
        /// <summary>
        /// constructor
        /// </summary>
        public override void LoadContent()
        {
            Pausable = true;
            ScreenOrder.SaveScreen(this);

            SoundManager.PlaySong("Cave_One_Portal", true);

            dbox = new DialogueBox("Scripts/caveScript.txt");
            dbox.LoadDBox();

            level = new Level("Levels/cave.bmp");
            level.LoadLevel();
            level.CamType = "center";
            level.SetPortalState(true);

            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"));

            friend1           = new Animation(ImageTools.LoadTexture2D("Characters/Friends/pat"), new int[] { 0, 0, 0, 0, 0, 1 }, 32, true);
            friend1.FrameTime = .75f;
            f1Pos             = new Vector2(2324, 800);

            friend2           = new Animation(ImageTools.LoadTexture2D("Characters/Friends/naomi"), new int[] { 0, 0, 1, 0, 0, 0 }, 32, true);
            friend2.FrameTime = .75f;
            f2Pos             = new Vector2(2370, 800);

            friendBoundingBox = new Rectangle((int)f1Pos.X, (int)f1Pos.Y, 110, 64);

            base.LoadContent();
        }
Exemplo n.º 4
0
        /// <summary>
        /// load game assets
        /// </summary>
        public override void LoadContent()
        {
            Pausable = true;
            ScreenOrder.SaveScreen(this);

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

            level            = new Level("Levels/endBoss.bmp");
            level.TileSetRow = 2;
            level.LoadLevel();
            level.Player.MovementEnabled = false;


            bossAnim = new Animation(ImageTools.LoadTexture2D("Characters/Bosses/wraith_animation"), 6, true);
            eyeD     = ImageTools.LoadTexture2D("Characters/Bosses/eyeball_D");

            leftChoice = ImageTools.LoadTexture2D("Graphics/Misc/crystal_ball_red");
            leftBound  = new Rectangle((int)level.Player.Position.X - 64, (int)level.Player.Position.Y, 32, 64);

            rightChoice = ImageTools.LoadTexture2D("Graphics/Misc/crystal_ball_blue");
            rightBound  = new Rectangle((int)level.Player.Position.X + 64, (int)level.Player.Position.Y, 32, 64);

            //dbox = new DialogueBox("Scripts/choiceScript.txt");
            //dbox.LoadDBox();
            background = new ParallaxBackground(ImageTools.LoadTexture2D("Graphics/Backgrounds/cave_level_3_background"),
                                                ImageTools.LoadTexture2D("Graphics/Backgrounds/cave_level_3_bottom_parallax"),
                                                ImageTools.LoadTexture2D("Graphics/Backgrounds/cave_level_3_top_parallax"));

            base.LoadContent();
        }
Exemplo n.º 5
0
        /// <summary>
        /// load game content
        /// </summary>
        public override void LoadContent()
        {
            Pausable = true;
            ScreenOrder.SaveScreen(this);

            SoundManager.PlaySong("Forest", true);
            SoundManager.AddLoopingSound("rainlong", .05f);

            level            = new Level("Levels/forest.bmp");
            level.TileSetRow = 0;
            level.LoadLevel();
            level.CamType = "center";


            cave       = ImageTools.LoadTexture2D("Graphics/Misc/cave");
            caveBounds = new Rectangle(4541, 512 - 64, 32 * 4, 64 * 2);

            storm = new ThunderStorm();

            background = new ParallaxBackground(ImageTools.LoadTexture2D("Graphics/Backgrounds/sun_background"),
                                                ImageTools.LoadTexture2D("Graphics/Backgrounds/mountains_parallax"), ImageTools.LoadTexture2D("Graphics/Backgrounds/clouds_parallax"));

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

            dbox2 = new DialogueBox("Scripts/forestScript2.txt");
            dbox2.LoadDBox();

            controls = new List <string>();
            controls.Add("Use <A> and <D> to move left and right and <W> or <Space> to jump.");
            controls.Add("This is your canteen.\nPress <Q> to take  a drink  and heal for 1 health.");
            controls.Add("This is your current health.");
            controls.Add("You can refill your canteen by interacting, <E>, with ponds like this.");
            controls.Add("Use the mouse to move your flashlight around.");
            controls.Add("You can pause the game by pressing <Escape>");

            controlsPos = new List <Vector2>();
            controlsPos.Add(level.Player.Position - new Vector2(210, 200));
            controlsPos.Add(new Vector2(1280 - 500, 960 - 75));
            controlsPos.Add(new Vector2(1280 - 245, 115));
            controlsPos.Add(new Vector2(2688 - 200, 416 + 70));
            controlsPos.Add(level.Player.Position - new Vector2(130, 150));
            controlsPos.Add(new Vector2(TextTools.CenterText(ScreenManager.ExtraSmallFont, controls[5]).X, 50));


            friend1           = new Animation(ImageTools.LoadTexture2D("Characters/Friends/pat"), new int[] { 0, 0, 0, 0, 0, 1 }, 32, true);
            friend1.FrameTime = .75f;
            f1Pos             = level.Player.Position + new Vector2(64, 0);

            friend2           = new Animation(ImageTools.LoadTexture2D("Characters/Friends/naomi"), new int[] { 0, 0, 1, 0, 0, 0 }, 32, true);
            friend2.FrameTime = .75f;
            f2Pos             = f1Pos + new Vector2(50, 0);

            friendBoundingBox = new Rectangle((int)f1Pos.X, (int)f1Pos.Y, 64 + 18, 64);

            ScreenManager.LightingEngine.SetLightPower(3);

            base.LoadContent();
        }
Exemplo n.º 6
0
        /// <summary>
        /// load assets
        /// </summary>
        public override void LoadContent()
        {
            Pausable = true;
            ScreenOrder.SaveScreen(this);

            report = ImageTools.LoadTexture2D("Graphics/Backgrounds/police report");

            base.LoadContent();
        }
Exemplo n.º 7
0
        /// <summary>
        /// load the content
        /// </summary>
        public override void LoadContent()
        {
            Pausable = true;
            ScreenOrder.SaveScreen(this);

            BackgroundColor = Color.Black;

            base.LoadContent();
        }
Exemplo n.º 8
0
        /// <summary>
        /// load image
        /// </summary>
        public override void LoadContent()
        {
            ScreenOrder.SaveScreen(this);

            SoundManager.PlaySong("Epilogue", true);

            image = ImageTools.LoadTexture2D("Graphics/Backgrounds/epilogue");

            base.LoadContent();
        }
Exemplo n.º 9
0
        /// <summary>
        /// update timer
        /// </summary>
        /// <param name="gameTime"></param>
        public override void Update(GameTime gameTime)
        {
            time += (float)gameTime.ElapsedGameTime.TotalSeconds;

            if (time >= 5)
            {
                ScreenManager.ChangeScreens(this, ScreenOrder.IdToScreen(LevelData.Load().LastScreen));
            }


            base.Update(gameTime);
        }
Exemplo n.º 10
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);
        }
Exemplo n.º 11
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();
        }
Exemplo n.º 12
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);
        }
Exemplo n.º 13
0
        /// <summary>
        /// load game content
        /// </summary>
        public override void LoadContent()
        {
            Pausable = true;
            ScreenOrder.SaveScreen(this);

            SoundManager.PlaySong("Boss_3", true);

            level            = new Level("Levels/endBoss.bmp");
            level.TileSetRow = 2;
            level.LoadLevel();
            level.CamType = "static";


            bossAnim           = new Animation(ImageTools.LoadTexture2D("Characters/Bosses/wraith_animation"), new int[] { 0, 1, 2, 3, 4, 5, 0 }, 384, false);
            bossAnim.FrameTime = .1f;
            boss = new Boss(10);

            eyeD          = ImageTools.LoadTexture2D("Characters/Bosses/eyeball_D");
            boss.Position = new Vector2(500, 20);
            velocity      = new Vector2(2, 0);

            leftBound  = new Rectangle(0, 0, 10, 300);
            rightBound = new Rectangle(1270, 0, 10, 300);

            boss.Projectiles.Add(new ShadowBall(level.Player, new Vector2(0, 5), new Vector2(150, 0)));
            boss.Projectiles.Add(new ShadowBall(level.Player, new Vector2(0, 5), new Vector2(350, 0)));
            boss.Projectiles.Add(new ShadowBall(level.Player, new Vector2(0, 5), new Vector2(550, 0)));
            boss.Projectiles.Add(new ShadowBall(level.Player, new Vector2(0, 5), new Vector2(750, 0)));
            boss.Projectiles.Add(new ShadowBall(level.Player, new Vector2(0, 5), new Vector2(950, 0)));
            boss.Projectiles.Add(new ShadowBall(level.Player, new Vector2(0, 5), new Vector2(1150, 0)));

            background = new ParallaxBackground(ImageTools.LoadTexture2D("Graphics/Backgrounds/cave_level_3_background"),
                                                ImageTools.LoadTexture2D("Graphics/Backgrounds/cave_level_3_bottom_parallax"),
                                                ImageTools.LoadTexture2D("Graphics/Backgrounds/cave_level_3_top_parallax"));


            base.LoadContent();
        }
Exemplo n.º 14
0
        /// <summary>
        /// load assets
        /// </summary>
        public override void LoadContent()
        {
            Pausable = true;
            ScreenOrder.SaveScreen(this);

            SoundManager.PlaySong("Hello", true);

            level = new Level("Levels/wakeUp.bmp");
            level.LoadLevel();
            level.CamType = "center";
            level.Player.MovementEnabled = false;

            dbox = new DialogueBox("Scripts/wakeUpScript.txt");
            dbox.LoadDBox();

            overlay = ImageTools.LoadTexture2D("Graphics/Overlays/lightning");

            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();
        }