Exemplo n.º 1
0
        public FinalBridge(GSPlay gsPlay)
            : base(gsPlay)
        {
            levelDataTexture = gsPlay.LoadTexture("Levels/bridge");

            //player1Pos = GridToPosition(79, 44);
            player2Pos = GridToPosition(6, 44);
            player1Pos = GridToPosition(131, 44);

            hasPortal = false;

            //portalPos = GridToPosition(681, 20);
            //pItemPos = GridToPosition(672

            SetupLevel();

            rightLimit = levelWidth;

            Vector2 bgPosition = new Vector2(-400, -400);
            SpriteIMG bg1 = new SpriteIMG(gsPlay.LoadTexture("BGs/mountainBackdropBaseBoth"), bgPosition);
            bg1.scale = new Vector2(1.5f);
            gsPlay.AddParallax(bg1, .1f);
            bgPosition = new Vector2(-600, -380);
            SpriteIMG bg2 = new SpriteIMG(gsPlay.LoadTexture("BGs/mountainBackdropOverlayBoth"), bgPosition);
            bg2.scale = new Vector2(2);
            gsPlay.AddParallax(bg2, .2f);

            for (int x = 1; x <= 5; x++)
            {
                for (int y = 1; y <= 2; y++)
                {
                    if (x == 5 && y == 1) continue;

                    SpriteIMG matte = new SpriteIMG(gsPlay.LoadTexture("BGs/bridgeMatte" + x + "x" + y), new Vector2(1024 * (x - 1) - 1078, 1024 * (y - 1) - 100));
                    gsPlay.AddParallax(matte, .5f);

                }
            }

            for (int x = 1; x <= 5; x++)
            {
                for (int y = 1; y <= 3; y++)
                {
                    string fgName = "LevelTiles/Bridge/bridgeFG" + x + "x" + y;
                    if (File.Exists("Content/" + fgName + ".xnb"))
                    {
                        SpriteIMG fg = gsPlay.AddFrontFGTile(gsPlay.LoadTexture(fgName), new Vector2(1024 * (x - 1), 1024 * (y - 1)));
                        fg.origin = Vector2.Zero;
                    }

                    string bgName = "LevelTiles/Bridge/bridgeBG" + x + "x" + y;
                    if (File.Exists("Content/" + bgName + ".xnb"))
                    {
                        SpriteIMG bg = gsPlay.AddBackFGTile(gsPlay.LoadTexture(bgName), new Vector2(1024 * (x - 1), 1024 * (y - 1)));
                        bg.origin = Vector2.Zero;
                    }

                }
            }

            for (int x = 1; x <= 5; x++)
            {
                SpriteIMG cloud = gsPlay.AddFrontFGTile(gsPlay.LoadTexture("LevelTiles/Bridge/clouds" + x + "x1"), new Vector2(1024 * (x - 1), 0));
                cloud.illuminatingAllTheTime = true;
                cloud.origin = Vector2.Zero;
            }

            Vector2 bridgePos = new Vector2(2160, 613.5f);
            gsPlay.AddFrontFGTile(gsPlay.LoadTexture("GameObjects/bridgeFull"), bridgePos);

            atmosphereLight = new Color(100, 100, 100);

            PointLight sun1 = gsPlay.AddPointLight(Art.whitePixel, GridToPosition(0, 0) + new Vector2(0, -200), new Vector2(2048, 1850));
            PointLight sun2 = gsPlay.AddPointLight(Art.whitePixel, GridToPosition(32, 0) + new Vector2(0, -200), new Vector2(2048, 1850));
            PointLight sun3 = gsPlay.AddPointLight(Art.whitePixel, GridToPosition(64, 0) + new Vector2(0, -200), new Vector2(2048, 1850));
            PointLight sun4 = gsPlay.AddPointLight(Art.whitePixel, GridToPosition(96, 0) + new Vector2(0, -200), new Vector2(2048, 1850));
            PointLight sun5 = gsPlay.AddPointLight(Art.whitePixel, GridToPosition(128, 0) + new Vector2(0, -200), new Vector2(2048, 1850));
            sun1.screenCull = false;
            sun2.screenCull = false;
            sun3.screenCull = false;
            sun4.screenCull = false;
            sun5.screenCull = false;

            finalField = gsPlay.AddBackFGTile(gsPlay.LoadTexture("Cutscene/finalField"), new Vector2(2175, 451));
            finalField.visible = false;

            Vector2 introPos = GridToPosition(41, 25) + new Vector2(0, 20);
            player1Ending = new AnimatedSprite(gsPlay.LoadTexture("Cutscene/cutscenePlayers"), introPos);
            player2Ending = new AnimatedSprite(gsPlay.LoadTexture("Cutscene/cutscenePlayers"), introPos);
            player1Ending.SetAnimationStuff(1, 1, 6, 8, 256, 256, 4, 12);
            player2Ending.SetAnimationStuff(1, 5, 6, 8, 256, 256, 4, 12);
            player1Ending.SetPlayerMode(PlayerObjectMode.One);
            player2Ending.SetPlayerMode(PlayerObjectMode.Two);
            gsPlay.frontFGList.Add(player1Ending);
            gsPlay.frontFGList.Add(player2Ending);
            player1Ending.visible = false;
            player2Ending.visible = false;

            player1FadeFrame = new AnimatedSprite(gsPlay.LoadTexture("player1Ideal"), Vector2.Zero);
            player2FadeFrame = new AnimatedSprite(gsPlay.LoadTexture("player2Ideal"), Vector2.Zero);
            player1FadeFrame.SetAnimationStuff(1, 1, 1, 6, 256, 256, 6, 8);
            player2FadeFrame.SetAnimationStuff(1, 1, 1, 6, 256, 256, 6, 8);
            player1FadeFrame.SetPlayerMode(PlayerObjectMode.Two);
            player2FadeFrame.SetPlayerMode(PlayerObjectMode.One);
            gsPlay.frontFGList.Add(player1FadeFrame);
            gsPlay.frontFGList.Add(player2FadeFrame);
            player1FadeFrame.visible = false;
            player2FadeFrame.visible = false;

            TriggerArea update = gsPlay.AddTriggerArea(new EventTrigger(this, 99), Art.smoke, Vector2.Zero);
            update.visible = false;
            gsPlay.AddTriggerArea(new EventTrigger(this, 0), gsPlay.LoadTexture("bridgeBreakTrigger"), GridToPosition(67, 50) + new Vector2(16, 0)).visible = false;

            AudioManager.PlayMusic("Bridge");
        }
Exemplo n.º 2
0
        public void StartIntro()
        {
            GSOverlay.words1.visible = true;
            GSOverlay.words2.visible = true;
            GSOverlay.words3.visible = true;
            GSOverlay.words4.visible = true;
            GSOverlay.words5.visible = true;
            GSOverlay.words6.visible = true;
            GSOverlay.words1.alpha = 0;
            GSOverlay.words2.alpha = 0;
            GSOverlay.words3.alpha = 0;
            GSOverlay.words4.alpha = 0;
            GSOverlay.words5.alpha = 0;
            GSOverlay.words6.alpha = 0;

            gsPlay.player1.superStopInput = true;
            gsPlay.player2.superStopInput = true;
            gsPlay.player1.visible = false;
            gsPlay.player2.visible = false;
            gsPlay.alphaDot.visible = false;

            Vector2 introPos = GridToPosition(41, 25) + new Vector2(0, 20);
            player1Intro = new AnimatedSprite(gsPlay.LoadTexture("Cutscene/cutscenePlayers"), introPos);
            player2Intro = new AnimatedSprite(gsPlay.LoadTexture("Cutscene/cutscenePlayers"), introPos);

            player2Intro.SetAnimationStuff(1, 1, 3, 8, 256, 256, 4, 12);
            player1Intro.SetAnimationStuff(1, 5, 3, 8, 256, 256, 4, 12);

            player1Intro.SetPlayerMode(PlayerObjectMode.One);
            player2Intro.SetPlayerMode(PlayerObjectMode.Two);

            gsPlay.frontFGList.Add(player1Intro);
            gsPlay.frontFGList.Add(player2Intro);

            gsPlay.PauseInput();
            if (!GameStateManager.isMultiplayer)
            {
                if (Mathness.RandomNumber(1, 2) == 1)
                    gsPlay.playerIndex = PlayerIndex.Two;
                else
                    gsPlay.playerIndex = PlayerIndex.One;
            }
        }