コード例 #1
0
        /// <summary>
        ///	TODO - add music
        ///	TODO - change tilesetrow
        /// </summary>
        /// <param name="groupIndex"></param>
        private void loadGroupInfo(int groupIndex)
        {
            switch (groupIndex)
            {
            case 0:
                ScreenManager.LightingEngine.SetLightPower(3);
                shadowCam.CamSpeed = 2.5f;
                enemy      = new Enemy(Player, 0);
                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"));
                groupBackground = ImageTools.LoadTexture2D("Graphics/Backgrounds/chapter 1");
                break;

            case 1:
                ScreenManager.LightingEngine.SetLightPower(3);
                shadowCam.CamSpeed = 2.5f;
                enemy      = new Enemy(Player, 9);
                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"));
                groupBackground = ImageTools.LoadTexture2D("Graphics/Backgrounds/chapter 2");
                break;

            case 2:
                ScreenManager.LightingEngine.SetLightPower(3);
                shadowCam.CamSpeed = 2.5f;
                enemy      = new Enemy(Player, 9);
                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"));
                groupBackground = ImageTools.LoadTexture2D("Graphics/Backgrounds/chapter 3");
                break;
            }
        }
コード例 #2
0
ファイル: CaveScreen.cs プロジェクト: hvak/Below
        /// <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();
        }
コード例 #3
0
ファイル: ForestScreen.cs プロジェクト: hvak/Below
        /// <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();
        }
コード例 #4
0
ファイル: Boss2Screen.cs プロジェクト: hvak/Below
        /// <summary>
        /// load info for each eye
        /// </summary>
        private void LoadEyes()
        {
            eyePos.Add(bossCam.shadowLocation + new Vector2(71, 53));
            eyePos.Add(bossCam.shadowLocation + new Vector2(93, 142));
            eyePos.Add(bossCam.shadowLocation + new Vector2(69, 264));
            eyePos.Add(bossCam.shadowLocation + new Vector2(91, 367));
            eyePos.Add(bossCam.shadowLocation + new Vector2(56, 467));
            eyePos.Add(bossCam.shadowLocation + new Vector2(73, 543));
            eyePos.Add(bossCam.shadowLocation + new Vector2(79, 665));
            eyePos.Add(bossCam.shadowLocation + new Vector2(101, 791));
            eyePos.Add(bossCam.shadowLocation + new Vector2(96, 906));

            eyeA = ImageTools.LoadTexture2D("Characters/Bosses/eyeball_A");
            eyeB = ImageTools.LoadTexture2D("Characters/Bosses/eyeball_B");
            eyeC = ImageTools.LoadTexture2D("Characters/Bosses/eyeball_C");
            eyeD = ImageTools.LoadTexture2D("Characters/Bosses/eyeball_D");

            eyes.Add(eyeC);
            eyes.Add(eyeA);
            eyes.Add(eyeD);
            eyes.Add(eyeB);
            eyes.Add(eyeA);
            eyes.Add(eyeD);
            eyes.Add(eyeC);
            eyes.Add(eyeA);
            eyes.Add(eyeB);
        }
コード例 #5
0
        /// <summary>
        /// load assets
        /// </summary>
        public override void LoadContent()
        {
            SoundManager.PlaySong("Credits", true);

            belowLogo   = ImageTools.LoadTexture2D("Graphics/Logos/below_logo");
            belowVector = ImageTools.CenterImage_vect(belowLogo);

            sharkboyLogo = ImageTools.LoadTexture2D("Graphics/Logos/sharkboylogo");
            sharkVector  = new Vector2(ImageTools.CenterImage_vect(sharkboyLogo).X, 1400);

            cogThoughtLogo = ImageTools.LoadTexture2D("Graphics/Logos/cognitive");
            cogVector      = new Vector2(ImageTools.CenterImage(cogThoughtLogo).X, 3100);

            hv1 = new Vector2(TextTools.CenterText(ScreenManager.MediumFont, h1).X, 5000);
            hv2 = new Vector2(TextTools.CenterText(ScreenManager.SmallFont, h2).X, 5070);

            av1 = new Vector2(TextTools.CenterText(ScreenManager.MediumFont, a1).X, 6000);
            av2 = new Vector2(TextTools.CenterText(ScreenManager.SmallFont, a2).X, 6070);

            dv1 = new Vector2(TextTools.CenterText(ScreenManager.MediumFont, d1).X, 7000);
            dv2 = new Vector2(TextTools.CenterText(ScreenManager.SmallFont, d2).X, 7070);

            sv1 = new Vector2(TextTools.CenterText(ScreenManager.MediumFont, s1).X, 8000);
            sv2 = new Vector2(TextTools.CenterText(ScreenManager.SmallFont, s2).X, 8070);

            cv1 = new Vector2(TextTools.CenterText(ScreenManager.SmallFont, c1).X, 9000);
            cv2 = new Vector2(TextTools.CenterText(ScreenManager.SmallFont, c2).X, 9070);

            base.LoadContent();
        }
コード例 #6
0
ファイル: Boss1Screen.cs プロジェクト: hvak/Below
        /// <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();
        }
コード例 #7
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();
        }
コード例 #8
0
ファイル: DialogueBox.cs プロジェクト: hvak/Below
        /// <summary>
        /// update game logic
        /// </summary>
        public void Update(GameTime gameTime)
        {
            if (isActive)
            {
                if (timerRunning)
                {
                    time += (float)gameTime.ElapsedGameTime.TotalSeconds;
                }

                if (currentDialogue != dialogues[Index])
                {
                    //to make the dialogue show up character by character
                    if (time >= charDelay)
                    {
                        SoundManager.PlaySound("charSound", .1f);
                        currentDialogue += dialogues[Index][charIndex];
                        charIndex++;
                        time = 0;
                    }
                }


                bool isDialogueLeft = true;

                if (isDialogueLeft)
                {
                    if (ScreenManager.AnyKeyPressed())
                    {
                        if (Index < dialogues.Count() - 1 && currentDialogue == dialogues[Index])
                        {
                            Index++;
                            currentDialogue = "";
                            timerRunning    = true;
                            charIndex       = 0;
                        }
                        else if (Index < dialogues.Count() - 1 && currentDialogue != dialogues[Index])
                        {
                            currentDialogue = dialogues[Index];
                        }
                        else
                        {
                            isDialogueLeft = false;
                        }

                        //set the current portrait to the person who is currently talking
                        currentPortrait = ImageTools.LoadTexture2D("Characters/Portraits/" + whoTalking[Index] + "Portrait");
                    }
                }

                if (!isDialogueLeft)
                {
                    if (ScreenManager.AnyKeyPressed())
                    {
                        isActive = false;
                        Finished = true;
                    }
                }
            }
        }
コード例 #9
0
ファイル: Portal.cs プロジェクト: hvak/Below
        /// <summary>
        /// constructor
        /// </summary>
        /// <param name="Player"></param>
        /// <param name="Position"></param>
        /// <param name="CurrentScreen"></param>
        /// <param name="TargetScreen"></param>
        public Portal(Level Level, Vector2 Position)
        {
            portal = ImageTools.LoadTexture2D("Graphics/Misc/finished_portal");

            level = Level;

            boundingRect = new Rectangle((int)Position.X, (int)Position.Y, portal.Width, portal.Height);
        }
コード例 #10
0
ファイル: Button.cs プロジェクト: hvak/Below
        /// <summary>
        /// constructor with default texture
        /// </summary>
        public Button()
        {
            buttonTexture = ImageTools.LoadTexture2D("Graphics/GUI/button");

            //set pos to -1000, 1000 to fix graphical but that causes the button to pop in the corner for a split second
            position = new Rectangle(-1000, -1000, buttonTexture.Width, buttonTexture.Height);

            Text = "Button";
        }
コード例 #11
0
ファイル: GrabberEnemy.cs プロジェクト: hvak/Below
        private bool checkingMovement = true;        //so that the state of one grabber enemy doesn't mess up other grabber enemies

        /// <summary>
        /// constructor
        /// </summary>
        /// <param name="Player"></param>
        /// <param name="Position"></param>
        public GrabberEnemy(Player Player, Vector2 Position)
        {
            player            = Player;
            enemy             = new Animation(ImageTools.LoadTexture2D("Characters/Enemies/venus_man_trap_animation"), 12, false);
            enemy.FrameTime   = .02f;
            position          = Position;
            boundingRectangle = new Rectangle((int)Position.X, (int)Position.Y, enemy.Width, enemy.Height);
            trueBounds        = new Rectangle((int)position.X + 4, (int)position.Y + 27, enemy.Width - 8, 37);
        }
コード例 #12
0
        /// <summary>
        /// load assets
        /// </summary>
        public override void LoadContent()
        {
            Pausable = true;
            ScreenOrder.SaveScreen(this);

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

            base.LoadContent();
        }
コード例 #13
0
ファイル: Ending2Screen.cs プロジェクト: hvak/Below
        /// <summary>
        /// load content
        /// </summary>
        public override void LoadContent()
        {
            SoundManager.PlaySong("Ambient", true);


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

            base.LoadContent();
        }
コード例 #14
0
ファイル: Canteen.cs プロジェクト: hvak/Below
        /// <summary>
        /// constructor
        /// </summary>
        /// <param name="Player"></param>
        public Canteen(Player Player)
        {
            player = Player;

            icon = ImageTools.LoadTexture2D("Graphics/Misc/canteen");

            PlayerData playerData = PlayerData.Load();

            usesRemaining = playerData.FlaskUses;
        }
コード例 #15
0
        /// <summary>
        /// load image
        /// </summary>
        public override void LoadContent()
        {
            ScreenOrder.SaveScreen(this);

            SoundManager.PlaySong("Epilogue", true);

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

            base.LoadContent();
        }
コード例 #16
0
ファイル: Enemy.cs プロジェクト: hvak/Below
        /// <summary>
        /// constructor
        /// </summary>
        /// <param name="Player"></param>
        public Enemy(Player Player, int Frequency)
        {
            enemy = ImageTools.LoadTexture2D("Characters/Enemies/swiping_enemy");

            player    = Player;
            frequency = Frequency;

            velocity = new Vector2(-1, 0);
            position = new Vector2(1300, player.Position.Y);

            BoundingRectangle = new Rectangle((int)position.X, (int)position.Y, enemy.Width, enemy.Height);
        }
コード例 #17
0
ファイル: Ray2D.cs プロジェクト: hvak/Below
        /// <summary>
        /// draw the line
        /// </summary>
        public void Draw()
        {
            List <Point> points = BresenhamLine(new Point((int)startPos.X, (int)startPos.Y), new Point((int)endPos.X, (int)endPos.Y));

            ScreenManager.SpriteBatch.Begin();

            foreach (Point point in result)
            {
                ScreenManager.SpriteBatch.Draw(ImageTools.LoadTexture2D("Graphics/Overlays/lightning"), new Vector2(point.X, point.Y), Color.Red);
            }

            ScreenManager.SpriteBatch.End();
        }
コード例 #18
0
        public bool Deflectable = true;        //prevent player from "catching" the ball

        public ShadowBall(Player Player, Vector2 Velocity, Vector2 StartPos)
        {
            player   = Player;
            velocity = Velocity;
            startPos = StartPos;
            position = startPos;

            BoundingRectangle = new Rectangle((int)position.X, (int)position.Y, 16, 16);

            List <Texture2D> parts = new List <Texture2D>();

            parts.Add(ImageTools.LoadTexture2D("Graphics/Particles/s1"));
            parts.Add(ImageTools.LoadTexture2D("Graphics/Particles/s2"));
            parts.Add(ImageTools.LoadTexture2D("Graphics/Particles/s3"));

            ball = new ParticleEngine(parts, position, false);
        }
コード例 #19
0
ファイル: Boss2Screen.cs プロジェクト: hvak/Below
        /// <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();
        }
コード例 #20
0
ファイル: Health.cs プロジェクト: hvak/Below
        /// <summary>
        /// constructor
        /// </summary>
        /// <param name="MaxHealth"></param>
        public Health(int MaxHealth, bool player)
        {
            this.MaxHealth = MaxHealth;

            isPlayer = player;

            if (player)
            {
                CurrentHealth = PlayerData.Load().Health;
            }
            else
            {
                CurrentHealth = MaxHealth;
            }

            overlay          = ImageTools.LoadTexture2D("Graphics/Overlays/damage flash");
            healthBar        = overlay;
            healthBarOutline = ImageTools.LoadTexture2D("Graphics/Misc/healthbar_outline");
        }
コード例 #21
0
        /// <summary>
        /// load tiles[,] from the colorMap
        /// </summary>
        /// <param name="colorMap"></param>
        public virtual void LoadLevel()
        {
            atlas = ImageTools.LoadTexture2D("Tiles/Atlas");

            Player = new Player(this, new Vector2(ScreenManager.SCREEN_WIDTH / 2, ScreenManager.SCREEN_HEIGHT / 2));

            //cycle through each color in the color map and assign a tile
            for (int h = 0; h < colorMap.GetLength(0); h++)
            {
                for (int w = 0; w < colorMap.GetLength(1); w++)
                {
                    if (colorMap[h, w] == Colors.Start)
                    {
                        //load player positioning and center camera
                        LoadPlayer(h, w);
                        ScreenManager.Camera.CenterX(Player.BoundingRectangle);
                    }
                    else if (colorMap[h, w] == Colors.End)
                    {
                        LoadExit(h, w);
                    }
                    else if (colorMap[h, w] == Colors.Grabber)
                    {
                        //load enemy tile
                        LoadGrabberEnemy(h, w);
                    }
                    else if (colorMap[h, w] == Colors.Water)
                    {
                        //load water tile
                        LoadWater(h, w);
                    }
                    else if (colorMap[h, w] == Colors.Portal)
                    {
                        //load a portal
                        Portal = new Portal(this, new Vector2(w * Tile.Size, (h - 3) * Tile.Size));
                    }

                    //place the tile
                    tiles[h, w] = PlaceTile(colorMap[h, w]);
                }
            }
        }
コード例 #22
0
ファイル: ParallaxBackground.cs プロジェクト: hvak/Below
        /// <summary>
        /// constructor
        /// </summary>
        /// <param name="StaticBackground"></param>
        /// <param name="Background1"></param>
        /// <param name="Background2"></param>
        public ParallaxBackground(Texture2D StaticBackground, Texture2D Background1, Texture2D Background2 = null)
        {
            staticBackground = StaticBackground;

            background1 = Background1;
            background2 = Background2;

            if (background2 == null)
            {
                background2 = ImageTools.LoadTexture2D("Graphics/Overlays/transparent");
            }

            b1Pos      = new Vector2(0, 0);
            b1ClonePos = new Vector2(background1.Width, 0);
            b1Vel      = new Vector2(.5f, 0);

            b2Pos      = new Vector2(0, 0);
            b2ClonePos = new Vector2(background2.Width, 0);
            b2Vel      = new Vector2(2, 0);
        }
コード例 #23
0
ファイル: DialogueBox.cs プロジェクト: hvak/Below
        /// <summary>
        /// load graphical content and load the dialogues and characters talking in the script
        /// </summary>
        public void LoadDBox()
        {
            box = ImageTools.LoadTexture2D("Graphics/GUI/dbox");

            boxLocation      = new Vector2(ImageTools.CenterImage_vect(box).X, 650);
            portraitLocation = new Vector2(boxLocation.X + 1, boxLocation.Y + 1);


            //split the script up
            foreach (string line in script)
            {
                string[] splitLine = line.Split('=');
                dialogues.Add(splitLine[1]);
                whoTalking.Add(splitLine[0]);
            }

            //custom coloring
            for (int i = 0; i < dialogues.Count; i++)
            {
                if (dialogues[i][0] == '*')
                {
                    if (dialogues[i][1] == 'b')
                    {
                        textColors.Add(Color.Aqua);
                    }
                    else if (dialogues[i][1] == 'r')
                    {
                        textColors.Add(Color.Red);
                    }

                    dialogues[i] = dialogues[i].Remove(0, 2);
                }
                else
                {
                    textColors.Add(Color.White);
                }
            }

            currentPortrait = ImageTools.LoadTexture2D("Characters/Portraits/" + whoTalking[0] + "Portrait");
        }
コード例 #24
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();
        }
コード例 #25
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();
        }
コード例 #26
0
        /// <summary>
        /// load assets
        /// </summary>
        public override void LoadContent()
        {
            SoundManager.PlaySong("Loop-1", true);

            ScreenManager.LightingEnabled = true;
            ScreenManager.LightingEngine.AmbientLightPower = 0.3f;

            belowLogo = ImageTools.LoadTexture2D("Graphics/Logos/below_logo");

            startButton      = new Button();
            startButton.Text = "Play";
            startButton.Location(540, 500);

            optionsButton      = new Button();
            optionsButton.Text = "Options";
            optionsButton.Location(540, 580);

            creditsButton      = new Button();
            creditsButton.Text = "Credits";
            creditsButton.Location(540, 660);

            exitButton      = new Button();
            exitButton.Text = "Exit";
            exitButton.Location(540, 740);

            resetButton      = new Button();
            resetButton.Text = "Reset Game";
            resetButton.Location(20, 890);
            resetButton.HoverColor     = Color.Red;
            resetButton.HoverTextColor = Color.Red;

            background = ImageTools.LoadTexture2D("Graphics/Backgrounds/mountain");



            base.LoadContent();
        }
コード例 #27
0
ファイル: Player.cs プロジェクト: hvak/Below
        /// <summary>
        /// load player content
        /// </summary>
        public void LoadContent()
        {
            Health  = new Health(5, true);
            Canteen = new Canteen(this);

            playerStanding = ImageTools.LoadTexture2D("Characters/Player/standing");
            playerForward  = new Animation(ImageTools.LoadTexture2D("Characters/Player/character_walk_right"), 6, true);
            playerBackward = new Animation(ImageTools.LoadTexture2D("Characters/Player/character_walk_backward"), 4, true);
            playerJump     = new Animation(ImageTools.LoadTexture2D("Characters/Player/jump"), 1, true);


            arm         = ImageTools.LoadTexture2D("Characters/Player/arm");
            armPosition = new Rectangle((int)position.X, (int)position.Y, arm.Width, arm.Height);

            lightPos = new Vector2(-300, -300);


            ScreenManager.LightingEngine.ClearLights();            //so light doesen't stay when new level is loaded
            flashLight = new SpotLight()
            {
                IsEnabled             = true,
                Color                 = Color.White,
                Power                 = 1f,
                LightDecay            = 200,
                Position              = new Vector3(lightPos.X, lightPos.Y, 5), //position.z controls width of the focus
                SpotBeamWidthExponent = 36,
                DirectionZ            = 0f                                      //0f//-.1f
            };
            flashLight.SpotRotation = 1f;
            ScreenManager.LightingEngine.AddLight(flashLight);

            boundingRectangle = new Rectangle(0, 0, 32, 64);


            setLineOfSight();
        }
コード例 #28
0
        private Color color = Color.Transparent;        //the color that will be manipulated to create the lightning effect

        //load sound effects

        /// <summary>
        /// create instance and load content
        /// </summary>
        public ThunderStorm()
        {
            rain      = new RainGenerator(ImageTools.LoadTexture2D("Graphics/Particles/raindrop"), 500, ScreenManager.SCREEN_WIDTH + 150);
            lightning = ImageTools.LoadTexture2D("Graphics/Overlays/lightning");
            random    = new Random();
        }
コード例 #29
0
        /// <summary>
        /// load assets
        /// </summary>
        public override void LoadContent()
        {
            logo = ImageTools.LoadTexture2D("Graphics/Logos/cognitive");

            base.LoadContent();
        }
コード例 #30
0
        /// <summary>
        /// load logo
        /// </summary>
        public override void LoadContent()
        {
            logo = ImageTools.LoadTexture2D("Graphics/Logos/sharkboylogo");

            base.LoadContent();
        }