Exemple #1
0
        public Level4(GSPlay gsPlay)
            : base(gsPlay)
        {
            levelDataTexture = gsPlay.LoadTexture("Levels/level4Data");

            player1Pos = GridToPosition(15, 10);
            player2Pos = GridToPosition(17, 10);

            //player1Pos = GridToPosition(197, 43);
            //player2Pos = player1Pos;

            portalPos = GridToPosition(232, 48);
            pItemPos = GridToPosition(194, 48);

            renderCollision = false;

            SetupLevel();

            for (int x = 1; x <= 8; x++)
            {
                for (int y = 1; y <= 3; y++)
                {

                    string bgName = "LevelTiles/Cave/caveCoolBG" + 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;
                        bg.SetPlayerMode(PlayerObjectMode.Two);
                    }

                }
            }
            for (int x = 1; x <= 8; x++)
            {
                for (int y = 1; y <= 3; y++)
                {

                    string bgName = "LevelTiles/Cave/caveWarmBG" + 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;
                        bg.SetPlayerMode(PlayerObjectMode.One);
                    }

                }
            }

            rightLimit = levelWidth - 32;

            Vector2 bgPosition = new Vector2(-400, -300);
            for (int x = 0; x < 2; x++)
            {
                SpriteIMG bg1 = new SpriteIMG(gsPlay.LoadTexture("BGs/caveBackdropBase1"), bgPosition);
                bg1.SetPlayerMode(PlayerObjectMode.One);
                gsPlay.AddParallax(bg1, .1f);
                SpriteIMG bg2 = new SpriteIMG(gsPlay.LoadTexture("BGs/caveBackdropBase2"), bgPosition);
                bg2.SetPlayerMode(PlayerObjectMode.Two);
                gsPlay.AddParallax(bg2, .1f);

                bgPosition.X += 1024;
            }

            bgPosition = new Vector2(-400, -300);
            for (int x = 0; x < 3; x++)
            {
                SpriteIMG bg1 = new SpriteIMG(gsPlay.LoadTexture("BGs/caveBackdropOverlay1"), bgPosition);
                bg1.SetPlayerMode(PlayerObjectMode.One);
                gsPlay.AddParallax(bg1, .2f);
                SpriteIMG bg2 = new SpriteIMG(gsPlay.LoadTexture("BGs/caveBackdropOverlay2"), bgPosition);
                bg2.SetPlayerMode(PlayerObjectMode.Two);
                gsPlay.AddParallax(bg2, .2f);

                bgPosition.X += 1024;
            }

            bgPosition = new Vector2(-300, -300);
            for (int x = 0; x < 5; x++)
            {
                for (int y = 0; y < 2; y++)
                {
                    SpriteIMG bg1 = new SpriteIMG(gsPlay.LoadTexture("BGs/caveMatte1"), bgPosition);
                    bg1.SetPlayerMode(PlayerObjectMode.One);
                    gsPlay.AddParallax(bg1, .5f);
                    SpriteIMG bg2 = new SpriteIMG(gsPlay.LoadTexture("BGs/caveMatte2"), bgPosition);
                    bg2.SetPlayerMode(PlayerObjectMode.Two);
                    gsPlay.AddParallax(bg2, .5f);

                    bgPosition.Y += 1024;
                }

                bgPosition.Y = -300;
                bgPosition.X += 1024;
            }

            gsPlay.AddBGWarmGear(gsPlay.LoadTexture("GameObjects/gearWarm1"), GridToCenterPosition(195, 45), 1.5f, .01f, 1);
            gsPlay.AddBGCoolGear(gsPlay.LoadTexture("GameObjects/gearCool1"), GridToCenterPosition(195, 45), 1.5f, .01f, 1);
            gsPlay.AddBGWarmGear(gsPlay.LoadTexture("GameObjects/gearWarm3"), GridToCenterPosition(198, 46), .75f, -.022f, 1);
            gsPlay.AddBGCoolGear(gsPlay.LoadTexture("GameObjects/gearCool3"), GridToCenterPosition(198, 46), .75f, -.022f, 1);
            gsPlay.AddBGWarmGear(gsPlay.LoadTexture("GameObjects/gearWarm2"), GridToCenterPosition(188, 46), 1f, -.02f, 1);
            gsPlay.AddBGCoolGear(gsPlay.LoadTexture("GameObjects/gearCool2"), GridToCenterPosition(188, 46), 1f, -.02f, 1);
            gsPlay.AddBGWarmGear(gsPlay.LoadTexture("GameObjects/gearWarm3"), GridToCenterPosition(206, 44), 1f, -.022f, 1);
            gsPlay.AddBGCoolGear(gsPlay.LoadTexture("GameObjects/gearCool3"), GridToCenterPosition(206, 44), 1f, -.022f, 1);

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

            gsPlay.AddPointLight(gsPlay.LoadTexture("ShaderAssets/pointLight"), GridToPosition(240, 44), new Vector2(4));

            //gsPlay.AddPointLight(gsPlay.LoadTexture("ShaderAssets/pointLight"), GridToPosition(15, 10), new Vector2(5));
            player1Light = gsPlay.AddPointLight(gsPlay.LoadTexture("ShaderAssets/pointLight"), Vector2.Zero, new Vector2(2));
            player1Light.SetGlowing(2, 2.4f, 120);
            player2Light = gsPlay.AddPointLight(gsPlay.LoadTexture("ShaderAssets/pointLight"), Vector2.Zero, new Vector2(2));
            player2Light.SetGlowing(2, 2.4f, 120);

            //Doors and switches
            Door d1 = gsPlay.AddFadingDoor(Art.door, GridToPosition(new Point(47, 42)), OpenState.Closed);
            FlipSwitch s1 = gsPlay.AddOnSwitch(new EventTrigger(this, d1), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(28, 54)));
            s1.SetPlayerMode(PlayerObjectMode.One);
            LightningChain lc1 = gsPlay.AddLightning(s1.position, s1.position + new Vector2(0, -208), Color.Orange);
            lc1.AddVertex(s1.position + new Vector2(384, -208));
            lc1.AddVertex(d1.position + new Vector2(0, 80));
            lc1.AddVertex(d1.position + new Vector2(0, 64));
            s1.AddEvent(new EventTrigger(this, lc1));
            lc1.defaultActive = true;
            lc1.SetActive(true);

            Door d2 = gsPlay.AddFadingDoor(Art.door, GridToPosition(new Point(108, 58)), OpenState.Closed);
            FlipSwitch s2 = gsPlay.AddOnSwitch(new EventTrigger(this, d2), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(62, 57)));
            s2.SetPlayerMode(PlayerObjectMode.One);
            LightningChain lc2 = gsPlay.AddLightning(s2.position, s2.position + new Vector2(0, 112), Color.Orange);
            lc2.AddVertex(d2.position + new Vector2(0, 80));
            lc2.AddVertex(d2.position + new Vector2(0, 64));
            s2.AddEvent(new EventTrigger(this, lc2));
            lc2.defaultActive = true;
            lc2.SetActive(true);

            Door d3 = gsPlay.AddFadingDoor(Art.door, GridToPosition(new Point(100, 39)), OpenState.Closed);
            FlipSwitch s3 = gsPlay.AddOnSwitch(new EventTrigger(this, d3), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(103, 40)));
            s3.SetPlayerMode(PlayerObjectMode.Two);
            LightningChain lc3 = gsPlay.AddLightning(s3.position, s3.position + new Vector2(0, 48), Color.Blue);
            lc3.AddVertex(d3.position + new Vector2(0, 80));
            lc3.AddVertex(d3.position + new Vector2(0, 64));
            s3.AddEvent(new EventTrigger(this, lc3));
            lc3.defaultActive = true;
            lc3.SetActive(true);

            Door d4 = gsPlay.AddFadingDoor(Art.door, GridToPosition(new Point(134, 23)), OpenState.Closed);
            FlipSwitch s4 = gsPlay.AddOnSwitch(new EventTrigger(this, d4), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(120, 33)));
            s4.SetPlayerMode(PlayerObjectMode.One);
            LightningChain lc4 = gsPlay.AddLightning(s4.position, s4.position + new Vector2(0, -192), Color.Orange);
            lc4.AddVertex(s4.position + new Vector2(112, -240));
            lc4.AddVertex(d4.position + new Vector2(0, 80));
            lc4.AddVertex(d4.position + new Vector2(0, 64));
            s4.AddEvent(new EventTrigger(this, lc4));
            lc4.defaultActive = true;
            lc4.SetActive(true);

            Door d5 = gsPlay.AddFadingDoor(Art.door, GridToPosition(new Point(159, 23)), OpenState.Closed);
            FlipSwitch s5 = gsPlay.AddOnSwitch(new EventTrigger(this, d5), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(156, 29)));
            LightningChain lc5 = gsPlay.AddLightning(s5.position, s5.position + new Vector2(0, -112), Color.Yellow);
            lc5.AddVertex(d5.position + new Vector2(0, 80));
            lc5.AddVertex(d5.position + new Vector2(0, 64));
            s5.AddEvent(new EventTrigger(this, lc5));
            lc5.defaultActive = true;
            lc5.SetActive(true);

            Door d6 = gsPlay.AddFadingDoor(Art.door, GridToPosition(new Point(164, 28)) + new Vector2(-16, 0), OpenState.Closed);
            FlipSwitch s6 = gsPlay.AddOnSwitch(new EventTrigger(this, d6), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(162, 24)));
            LightningChain lc6 = gsPlay.AddLightning(s6.position, s6.position + new Vector2(0, 48), Color.Yellow);
            lc6.AddVertex(d6.position + new Vector2(0, -80));
            lc6.AddVertex(d6.position + new Vector2(0, -64));
            s6.AddEvent(new EventTrigger(this, lc6));
            lc6.defaultActive = true;
            lc6.SetActive(true);

            Door d7 = gsPlay.AddFadingDoor(Art.door, GridToPosition(new Point(188, 33)) + new Vector2(-16, 0), OpenState.Closed);
            FlipSwitch s7 = gsPlay.AddOnSwitch(new EventTrigger(this, d7), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(192, 29)));
            LightningChain lc7 = gsPlay.AddLightning(s7.position, s7.position + new Vector2(0, 48), Color.Yellow);
            lc7.AddVertex(d7.position + new Vector2(0, -80));
            lc7.AddVertex(d7.position + new Vector2(0, -64));
            s7.AddEvent(new EventTrigger(this, lc7));
            lc7.defaultActive = true;
            lc7.SetActive(true);

            Door d8 = gsPlay.AddFadingDoor(Art.door, GridToPosition(new Point(178, 28)), OpenState.Closed);
            FlipSwitch s8 = gsPlay.AddOnSwitch(new EventTrigger(this, d8), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(176, 29)));
            LightningChain lc8 = gsPlay.AddLightning(s8.position, s8.position + new Vector2(0, 48), Color.Yellow);
            lc8.AddVertex(d8.position + new Vector2(0, 80));
            lc8.AddVertex(d8.position + new Vector2(0, 64));
            s8.AddEvent(new EventTrigger(this, lc8));
            lc8.defaultActive = true;
            lc8.SetActive(true);

            Door d9 = gsPlay.AddFadingDoor(Art.door, GridToPosition(new Point(169, 33)) + new Vector2(-16, 0), OpenState.Closed);
            FlipSwitch s9 = gsPlay.AddOnSwitch(new EventTrigger(this, d9), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(172, 39)));
            LightningChain lc9 = gsPlay.AddLightning(s9.position, s9.position + new Vector2(0, 48), Color.Yellow);
            lc9.AddVertex(s9.position + new Vector2(-112, 48));
            lc9.AddVertex(d9.position + new Vector2(0, 64));
            s9.AddEvent(new EventTrigger(this, lc9));
            lc9.defaultActive = true;
            lc9.SetActive(true);

            Door d10 = gsPlay.AddFadingDoor(Art.door, GridToPosition(new Point(174, 63)), OpenState.Closed);
            FlipSwitch s10 = gsPlay.AddOnSwitch(new EventTrigger(this, d10), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(173, 69)));
            LightningChain lc10 = gsPlay.AddLightning(s10.position, s10.position + new Vector2(0, -112), Color.Yellow);
            lc10.AddVertex(d10.position + new Vector2(0, 80));
            lc10.AddVertex(d10.position + new Vector2(0, 64));
            s10.AddEvent(new EventTrigger(this, lc10));
            lc10.defaultActive = true;
            lc10.SetActive(true);

            Door d11 = gsPlay.AddFadingDoor(Art.door, GridToPosition(new Point(187, 73)), OpenState.Closed);
            FlipSwitch s11 = gsPlay.AddOnSwitch(new EventTrigger(this, d11), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(173, 74)));
            LightningChain lc11 = gsPlay.AddLightning(s11.position, s11.position + new Vector2(0, 48), Color.Yellow);
            lc11.AddVertex(d11.position + new Vector2(0, 80));
            lc11.AddVertex(d11.position + new Vector2(0, 64));
            s11.AddEvent(new EventTrigger(this, lc11));
            lc11.defaultActive = true;
            lc11.SetActive(true);

            Door d12 = gsPlay.AddOpeningDoor(Art.door, GridToPosition(new Point(180, 73)), GridToPosition(new Point(180, 68)), OpenState.Closed);
            FlipSwitch s12 = gsPlay.AddMultiSwitch(new EventTrigger(this, d12), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(173, 74)));
            LightningChain lc12 = gsPlay.AddLightning(s12.position, s12.position + new Vector2(0, -112), Color.Yellow);
            lc12.AddVertex(d12.position + new Vector2(0, 80));
            lc12.AddVertex(d12.position + new Vector2(0, 64));
            lc12.ConvertEndPointToTarget(d12);
            s12.AddEvent(new EventTrigger(this, lc12));

            Door d13 = gsPlay.AddFadingDoor(Art.door, GridToPosition(new Point(171, 78)), OpenState.Closed);
            FlipSwitch s13 = gsPlay.AddOnSwitch(new EventTrigger(this, d13), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(174, 79)));
            LightningChain lc13 = gsPlay.AddLightning(s13.position, s13.position + new Vector2(0, 48), Color.Yellow);
            lc13.AddVertex(d13.position + new Vector2(0, 80));
            lc13.AddVertex(d13.position + new Vector2(0, 64));
            s13.AddEvent(new EventTrigger(this, lc13));
            lc13.defaultActive = true;
            lc13.SetActive(true);

            Door d14 = gsPlay.AddFadingDoor(Art.door, GridToPosition(new Point(197, 78)) + new Vector2(-16, 0), OpenState.Closed);
            FlipSwitch s14 = gsPlay.AddOnSwitch(new EventTrigger(this, d14), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(199, 74)));
            LightningChain lc14 = gsPlay.AddLightning(s14.position, s14.position + new Vector2(0, 48), Color.Yellow);
            lc14.AddVertex(d14.position + new Vector2(0, -80));
            lc14.AddVertex(d14.position + new Vector2(0, -64));
            s14.AddEvent(new EventTrigger(this, lc14));
            lc14.defaultActive = true;
            lc14.SetActive(true);

            Door d15 = gsPlay.AddFadingDoor(Art.door, GridToPosition(new Point(202, 58)), OpenState.Closed);
            FlipSwitch s15 = gsPlay.AddOnSwitch(new EventTrigger(this, d15), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(200, 64)));
            LightningChain lc15 = gsPlay.AddLightning(s15.position, s15.position + new Vector2(0, -112), Color.Yellow);
            lc15.AddVertex(d15.position + new Vector2(0, 80));
            lc15.AddVertex(d15.position + new Vector2(0, 64));
            s15.AddEvent(new EventTrigger(this, lc15));
            lc15.defaultActive = true;
            lc15.SetActive(true);

            Door d16 = gsPlay.AddFadingDoor(Art.door, GridToPosition(new Point(212, 63)), OpenState.Closed);
            FlipSwitch s16 = gsPlay.AddOnSwitch(new EventTrigger(this, d16), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(209, 60)));
            LightningChain lc16 = gsPlay.AddLightning(s16.position, s16.position + new Vector2(0, 48), Color.Yellow);
            lc16.AddVertex(d16.position + new Vector2(0, -80));
            lc16.AddVertex(d16.position + new Vector2(0, -64));
            s16.AddEvent(new EventTrigger(this, lc16));
            lc16.defaultActive = true;
            lc16.SetActive(true);

            Door d17 = gsPlay.AddFadingDoor(gsPlay.LoadTexture("TestSprites/door2"), GridToPosition(new Point(211, 38)) + new Vector2(-16, 0), OpenState.Closed);
            Door d26 = gsPlay.AddFadingDoor(gsPlay.LoadTexture("TestSprites/door2"), GridToPosition(new Point(212, 38)) + new Vector2(-16, 0), OpenState.Closed);
            Door d27 = gsPlay.AddFadingDoor(gsPlay.LoadTexture("TestSprites/door2"), GridToPosition(new Point(213, 38)) + new Vector2(-16, 0), OpenState.Closed);
            Door d28 = gsPlay.AddFadingDoor(gsPlay.LoadTexture("TestSprites/door2"), GridToPosition(new Point(214, 38)) + new Vector2(-16, 0), OpenState.Closed);
            Door d29 = gsPlay.AddFadingDoor(gsPlay.LoadTexture("TestSprites/door2"), GridToPosition(new Point(215, 38)) + new Vector2(-16, 0), OpenState.Closed);
            Door d30 = gsPlay.AddFadingDoor(gsPlay.LoadTexture("TestSprites/door2"), GridToPosition(new Point(216, 38)) + new Vector2(-16, 0), OpenState.Closed);
            FlipSwitch s17 = gsPlay.AddOnSwitch(new EventTrigger(this, d17), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(209, 44)));
            s17.AddEvent(new EventTrigger(this, d26));
            s17.AddEvent(new EventTrigger(this, d27));
            s17.AddEvent(new EventTrigger(this, d28));
            s17.AddEvent(new EventTrigger(this, d29));
            s17.AddEvent(new EventTrigger(this, d30));
            LightningChain lc17 = gsPlay.AddLightning(s17.position, s17.position + new Vector2(0, 48), Color.Yellow);
            lc17.AddVertex(s17.position + new Vector2(80, 48));
            lc17.AddVertex(s17.position + new Vector2(80, -112));
            lc17.AddVertex(s17.position + new Vector2(166, -112));
            s17.AddEvent(new EventTrigger(this, lc17));
            lc17.defaultActive = true;
            lc17.SetActive(true);

            Door d31 = gsPlay.AddFadingDoor(Art.door, GridToPosition(new Point(189, 48)), OpenState.Closed);
            FlipSwitch s18 = gsPlay.AddSwitch(new EventTrigger(this, d31), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(214, 39)));
            LightningChain lc18 = gsPlay.AddLightning(s18.position, GridToCenterPosition(214, 40) + new Vector2(-16,0), Color.Red);
            lc18.AddVertex(GridToCenterPosition(211, 40));
            lc18.AddVertex(GridToCenterPosition(211, 45));
            lc18.AddVertex(GridToCenterPosition(200, 45) + new Vector2(-16, 0));
            lc18.AddVertex(GridToPosition(200, 46));
            s18.AddEvent(new EventTrigger(this, lc18));

            Door d32 = gsPlay.AddFadingDoor(Art.door, GridToPosition(new Point(200, 48)), OpenState.Closed);
            FlipSwitch s19 = gsPlay.AddSwitch(new EventTrigger(this, d32), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(214, 39)));
            LightningChain lc19 = gsPlay.AddLightning(GridToCenterPosition(200, 45) + new Vector2(-16, 0), GridToCenterPosition(189, 45) + new Vector2(-16,0), Color.Red);
            lc19.AddVertex(GridToPosition(189, 46));
            s19.AddEvent(new EventTrigger(this, lc19));

            //static doors to block a players path
            Door d18 = gsPlay.AddFadingDoor(gsPlay.LoadTexture("TestSprites/door2"), GridToPosition(new Point(196, 33)) + new Vector2(-16, 0), OpenState.Closed);
            d18.SetPlayerMode(PlayerObjectMode.Two);
            Door d19 = gsPlay.AddFadingDoor(gsPlay.LoadTexture("TestSprites/door2"), GridToPosition(new Point(159, 48)) + new Vector2(-16, 0), OpenState.Closed);
            d19.SetPlayerMode(PlayerObjectMode.One);
            Door d20 = gsPlay.AddFadingDoor(gsPlay.LoadTexture("TestSprites/door2"), GridToPosition(new Point(197, 73)) + new Vector2(-16, 0), OpenState.Closed);
            d20.SetPlayerMode(PlayerObjectMode.Two);
            Door d21 = gsPlay.AddFadingDoor(gsPlay.LoadTexture("TestSprites/door2"), GridToPosition(new Point(212, 58)) + new Vector2(-16, 0), OpenState.Closed);
            d21.SetPlayerMode(PlayerObjectMode.Two);
            Door d22 = gsPlay.AddFadingDoor(gsPlay.LoadTexture("TestSprites/door2"), GridToPosition(new Point(212, 48)) + new Vector2(-16, 0), OpenState.Closed);
            d22.SetPlayerMode(PlayerObjectMode.One);
            Door d23 = gsPlay.AddFadingDoor(gsPlay.LoadTexture("TestSprites/door2"), GridToPosition(new Point(197, 78)) + new Vector2(-16, 0), OpenState.Closed);
            d23.SetPlayerMode(PlayerObjectMode.One);
            Door d24 = gsPlay.AddFadingDoor(gsPlay.LoadTexture("TestSprites/door2"), GridToPosition(new Point(164, 48)) + new Vector2(-16, 0), OpenState.Closed);
            d24.SetPlayerMode(PlayerObjectMode.One);
            gsPlay.AddSwitch(new EventTrigger(this, d24), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(209, 60)));
            Door d25 = gsPlay.AddFadingDoor(gsPlay.LoadTexture("TestSprites/door2"), GridToPosition(new Point(159, 23)), OpenState.Closed);
            d25.SetPlayerMode(PlayerObjectMode.Two);

            //movables
            gsPlay.AddMoveable(gsPlay.LoadTexture("TestSprites/moveableMechanical"), Level.GridToPosition(new Point(74, 67)), .8f);

            //platforms used to block a players path
            MovingPlatform p1 = gsPlay.AddReversePlatform(gsPlay.LoadTexture("TestSprites/platform2a"), Level.GridToPosition(new Point(144, 26)) + new Vector2(0, -16), Level.GridToPosition(new Point(144, 26)) + new Vector2(0, -16));
            p1.SetPlayerMode(PlayerObjectMode.One);
            p1.SetCollisionBox(128, 32, Vector2.Zero);
            MovingPlatform p2 = gsPlay.AddReversePlatform(gsPlay.LoadTexture("TestSprites/platform2a"), Level.GridToPosition(new Point(166, 26)) + new Vector2(0, -16), Level.GridToPosition(new Point(166, 26)) + new Vector2(0, -16));
            p2.SetPlayerMode(PlayerObjectMode.One);
            p2.SetCollisionBox(128, 32, Vector2.Zero);
            MovingPlatform p3 = gsPlay.AddReversePlatform(gsPlay.LoadTexture("TestSprites/platform2a"), Level.GridToPosition(new Point(198, 26)) + new Vector2(0, -16), Level.GridToPosition(new Point(198, 26)) + new Vector2(0, -16));
            p3.SetPlayerMode(PlayerObjectMode.One);
            p3.SetCollisionBox(128, 32, Vector2.Zero);
            MovingPlatform p4 = gsPlay.AddReversePlatform(gsPlay.LoadTexture("TestSprites/platform2b"), Level.GridToPosition(new Point(208, 26)) + new Vector2(0, -16), Level.GridToPosition(new Point(208, 26)) + new Vector2(0, -16));
            p4.SetPlayerMode(PlayerObjectMode.Two);
            p4.SetCollisionBox(128, 32, Vector2.Zero);
            MovingPlatform p5 = gsPlay.AddReversePlatform(gsPlay.LoadTexture("TestSprites/platform2a"), Level.GridToPosition(new Point(193, 36)) + new Vector2(0, -16), Level.GridToPosition(new Point(193, 36)) + new Vector2(0, -16));
            p5.SetPlayerMode(PlayerObjectMode.One);
            p5.SetCollisionBox(128, 32, Vector2.Zero);
            MovingPlatform p6 = gsPlay.AddReversePlatform(gsPlay.LoadTexture("TestSprites/platform2b"), Level.GridToPosition(new Point(161, 51)) + new Vector2(0, -16), Level.GridToPosition(new Point(161, 51)) + new Vector2(0, -16));
            p6.SetPlayerMode(PlayerObjectMode.Two);
            p6.SetCollisionBox(128, 32, Vector2.Zero);
            MovingPlatform p7 = gsPlay.AddReversePlatform(gsPlay.LoadTexture("TestSprites/platform2a"), Level.GridToPosition(new Point(219, 61)) + new Vector2(0, -16), Level.GridToPosition(new Point(219, 61)) + new Vector2(0, -16));
            p7.SetPlayerMode(PlayerObjectMode.One);
            p7.SetCollisionBox(128, 32, Vector2.Zero);
            MovingPlatform p8 = gsPlay.AddReversePlatform(gsPlay.LoadTexture("TestSprites/platform2b"), Level.GridToPosition(new Point(214, 56)) + new Vector2(0, -16), Level.GridToPosition(new Point(214, 56)) + new Vector2(0, -16));
            p8.SetPlayerMode(PlayerObjectMode.Two);
            p8.SetCollisionBox(128, 32, Vector2.Zero);
            MovingPlatform p9 = gsPlay.AddReversePlatform(gsPlay.LoadTexture("TestSprites/platform2b"), Level.GridToPosition(new Point(219, 51)) + new Vector2(0, -16), Level.GridToPosition(new Point(219, 51)) + new Vector2(0, -16));
            p9.SetPlayerMode(PlayerObjectMode.Two);
            p9.SetCollisionBox(128, 32, Vector2.Zero);
            MovingPlatform p10 = gsPlay.AddReversePlatform(gsPlay.LoadTexture("TestSprites/platform2a"), Level.GridToPosition(new Point(219, 56)) + new Vector2(0, -16), Level.GridToPosition(new Point(219, 56)) + new Vector2(0, -16));
            p10.SetPlayerMode(PlayerObjectMode.One);
            p10.SetCollisionBox(128, 32, Vector2.Zero);
            MovingPlatform p11 = gsPlay.AddReversePlatform(gsPlay.LoadTexture("TestSprites/platform2a"), Level.GridToPosition(new Point(214, 51)) + new Vector2(0, -16), Level.GridToPosition(new Point(214, 51)) + new Vector2(0, -16));
            p11.SetPlayerMode(PlayerObjectMode.One);
            p11.SetCollisionBox(128, 32, Vector2.Zero);
            MovingPlatform p12 = gsPlay.AddReversePlatform(gsPlay.LoadTexture("TestSprites/platform2b"), Level.GridToPosition(new Point(56, 69)) + new Vector2(0, -16), Level.GridToPosition(new Point(56, 69)) + new Vector2(0, -16));
            p12.SetPlayerMode(PlayerObjectMode.Two);
            p12.SetCollisionBox(128, 32, Vector2.Zero);
            MovingPlatform p13 = gsPlay.AddReversePlatform(gsPlay.LoadTexture("TestSprites/platform2b"), Level.GridToPosition(new Point(60, 69)) + new Vector2(0, -16), Level.GridToPosition(new Point(59, 69)) + new Vector2(0, -16));
            p13.SetPlayerMode(PlayerObjectMode.Two);
            p13.SetCollisionBox(128, 32, Vector2.Zero);
            MovingPlatform p14 = gsPlay.AddReversePlatform(gsPlay.LoadTexture("TestSprites/platform2b"), Level.GridToPosition(new Point(64, 69)) + new Vector2(0, -16), Level.GridToPosition(new Point(62, 69)) + new Vector2(0, -16));
            p14.SetPlayerMode(PlayerObjectMode.Two);
            p14.SetCollisionBox(128, 32, Vector2.Zero);
            MovingPlatform p16 = gsPlay.AddReversePlatform(gsPlay.LoadTexture("TestSprites/platform2b"), Level.GridToPosition(new Point(89, 39)) + new Vector2(0, -16), Level.GridToPosition(new Point(89, 39)) + new Vector2(0, -16));
            p16.SetPlayerMode(PlayerObjectMode.Two);
            p16.SetCollisionBox(128, 32, Vector2.Zero);
            MovingPlatform p17 = gsPlay.AddReversePlatform(gsPlay.LoadTexture("TestSprites/platform2b"), Level.GridToPosition(new Point(85, 38)) + new Vector2(0, -16), Level.GridToPosition(new Point(86, 38)) + new Vector2(0, -16));
            p17.SetPlayerMode(PlayerObjectMode.Two);
            p17.SetCollisionBox(128, 32, Vector2.Zero);

            //Lights
            //15,58
            LightConsole console1 = gsPlay.AddLightConsole(gsPlay.LoadTexture("TestSprites/LightConsole"), GridToPosition(15, 58));
            //LightConsole console1 = gsPlay.AddLightConsole(gsPlay.LoadTexture("TestSprites/LightConsole"), GridToPosition(140, 24));
            console1.AddLight(player1Light);
            console1.SetPlayerMode(PlayerObjectMode.One);
            LightConsole console2 = gsPlay.AddLinkedLightConsole(console1, console1.texture, GridToPosition(0, 0));
            console2.AddLight(player2Light);
            console2.SetPlayerMode(PlayerObjectMode.One);

            LightConsole console3 = gsPlay.AddLightConsole(gsPlay.LoadTexture("TestSprites/LightConsole"), GridToPosition(30, 45));
            LightConsole console4 = gsPlay.AddLinkedLightConsole(console3, console3.texture, GridToPosition(0, 0));

            LightConsole console5 = gsPlay.AddLightConsole(gsPlay.LoadTexture("TestSprites/LightConsole"), GridToPosition(51, 67));
            LightConsole console6 = gsPlay.AddLinkedLightConsole(console5, console5.texture, GridToPosition(0, 0));

            LightConsole console7 = gsPlay.AddLightConsole(gsPlay.LoadTexture("TestSprites/LightConsole"), GridToPosition(94, 59));
            gsPlay.AddLinkedLightConsole(console7, console7.texture, GridToPosition(0, 0));

            LightConsole console8 = gsPlay.AddLightConsole(gsPlay.LoadTexture("TestSprites/LightConsole"), GridToPosition(105, 52));
            gsPlay.AddLinkedLightConsole(console8, console8.texture, GridToPosition(0, 0));

            LightConsole console9 = gsPlay.AddLightConsole(gsPlay.LoadTexture("TestSprites/LightConsole"), GridToPosition(129, 23));
            LightConsole console9a = gsPlay.AddLinkedLightConsole(console9, console9.texture, GridToPosition(0, 0));
            //console9.AddLight(player1Light);
            //console9a.AddLight(player2Light);

            LightConsole console10 = gsPlay.AddLightConsole(gsPlay.LoadTexture("TestSprites/LightConsole"), GridToPosition(147, 24));
            console10.SetPlayerMode(PlayerObjectMode.One);
            LightConsole console11 = gsPlay.AddLinkedLightConsole(console10, console10.texture, GridToPosition(147, 29));
            console11.SetPlayerMode(PlayerObjectMode.Two);
            LightningChain clc1 = gsPlay.AddLightning(console10.position, console11.position, Color.White);
            console10.AddEvent(new EventTrigger(this, clc1));
            console11.AddEvent(new EventTrigger(this, clc1));

            LightConsole console12 = gsPlay.AddLightConsole(gsPlay.LoadTexture("TestSprites/LightConsole"), GridToPosition(205, 24));
            console12.SetPlayerMode(PlayerObjectMode.Two);
            LightConsole console13 = gsPlay.AddLinkedLightConsole(console12, console12.texture, GridToPosition(205, 39));
            console13.SetPlayerMode(PlayerObjectMode.One);
            LightningChain clc2 = gsPlay.AddLightning(console12.position, console13.position, Color.White);
            console12.AddEvent(new EventTrigger(this, clc2));
            console13.AddEvent(new EventTrigger(this, clc2));

            LightConsole console14 = gsPlay.AddLightConsole(gsPlay.LoadTexture("TestSprites/LightConsole"), GridToPosition(191, 34));
            console14.SetPlayerMode(PlayerObjectMode.One);
            LightConsole console15 = gsPlay.AddLinkedLightConsole(console14, console14.texture, GridToPosition(191, 39));
            console15.SetPlayerMode(PlayerObjectMode.Two);
            LightningChain clc3 = gsPlay.AddLightning(console14.position, console15.position, Color.White);
            console14.AddEvent(new EventTrigger(this, clc3));
            console15.AddEvent(new EventTrigger(this, clc3));

            LightConsole console16 = gsPlay.AddLightConsole(gsPlay.LoadTexture("TestSprites/LightConsole"), GridToPosition(157, 69));
            console16.SetPlayerMode(PlayerObjectMode.Two);
            LightConsole console17 = gsPlay.AddLinkedLightConsole(console16, console16.texture, GridToPosition(162, 64));
            console17.SetPlayerMode(PlayerObjectMode.One);
            LightningChain clc4 = gsPlay.AddLightning(console16.position, console17.position, Color.White);
            console16.AddEvent(new EventTrigger(this, clc4));
            console17.AddEvent(new EventTrigger(this, clc4));

            LightConsole console18 = gsPlay.AddLightConsole(gsPlay.LoadTexture("TestSprites/LightConsole"), GridToPosition(190, 79));
            console18.SetPlayerMode(PlayerObjectMode.Two);
            LightConsole console19 = gsPlay.AddLinkedLightConsole(console18, console18.texture, GridToPosition(185, 84));
            console19.SetPlayerMode(PlayerObjectMode.One);
            LightningChain clc5 = gsPlay.AddLightning(console18.position, console19.position, Color.White);
            console18.AddEvent(new EventTrigger(this, clc5));
            console19.AddEvent(new EventTrigger(this, clc5));

            LightConsole console20 = gsPlay.AddLightConsole(gsPlay.LoadTexture("TestSprites/LightConsole"), GridToPosition(189, 69));
            console20.SetPlayerMode(PlayerObjectMode.One);
            LightConsole console21 = gsPlay.AddLinkedLightConsole(console20, console20.texture, GridToPosition(209, 69));
            console21.SetPlayerMode(PlayerObjectMode.Two);
            LightningChain clc6 = gsPlay.AddLightning(console20.position, console21.position, Color.White);
            console20.AddEvent(new EventTrigger(this, clc6));
            console21.AddEvent(new EventTrigger(this, clc6));

            LightConsole console22 = gsPlay.AddLightConsole(gsPlay.LoadTexture("TestSprites/LightConsole"), GridToPosition(212, 39));
            LightConsole console23 = gsPlay.AddLinkedLightConsole(console22, console22.texture, GridToPosition(198, 49));
            LightningChain clc7 = gsPlay.AddLightning(console22.position, console23.position, Color.White);
            console22.AddEvent(new EventTrigger(this, clc1));
            console23.AddEvent(new EventTrigger(this, clc1));

            AudioManager.PlayMusic("Cave");
        }
        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");
        }
Exemple #3
0
        public TestLevel(GSPlay gsPlay)
            : base(gsPlay)
        {
            levelDataTexture = gsPlay.LoadTexture("TestSprites/testLevelData");

            player1Pos = GridToPosition(175, 25);
            player2Pos = GridToPosition(24, 47);

            portalPos = GridToPosition(211, 12);
            pItemPos = GridToPosition(204, 12);

            renderCollision = true;

            SetupLevel();

            leftLimit = 32;
            rightLimit = levelWidth;

            //gsPlay.AddSpinningFireParticle(GridToPosition(7, 47));

            LightningChain bolt = gsPlay.AddLightning(GridToPosition(24, 42), GridToPosition(27, 42), Color.White);
            bolt.AddVertex(GridToPosition(27, 38));
            bolt.SetActive(true);

            SpriteIMG bg = new SpriteIMG(gsPlay.LoadTexture("TestSprites/testWash1"), new Vector2(levelWidth/2, levelHeight/2));
            gsPlay.AddParallax(bg, .5f);
            FadingBackground bg2 = new FadingBackground(gsPlay.LoadTexture("TestSprites/testWash2"), new Vector2(levelWidth / 2, levelHeight / 2));
            gsPlay.AddParallax(bg2, .75f);
            bg2.SetFading(120, 10);
            bg2.SetMoving(bg2.position, bg2.position + new Vector2(-1000, 0), 2, 0);

            //SpriteIMG s = new SpriteIMG(gsPlay.LoadTexture("bgSky"), new Vector2(levelWidth / 2, levelHeight / 2));
            //gsPlay.AddParallax(s, .5f);

            //SpriteIMG fg = new SpriteIMG(gsPlay.LoadTexture("TestSprites/environmentArt1"));
            //fg.origin = Vector2.Zero;
            //gsPlay.tileList.Add(fg);

            //fg = new SpriteIMG(gsPlay.LoadTexture("TestSprites/environmentArt2"), new Vector2(2048, 0));
            //fg.origin = Vector2.Zero;
            //gsPlay.tileList.Add(fg);

            //fg = new SpriteIMG(gsPlay.LoadTexture("TestSprites/environmentArt3"), new Vector2(4096, 0));
            //fg.origin = Vector2.Zero;
            //gsPlay.tileList.Add(fg);

            //fg = new SpriteIMG(gsPlay.LoadTexture("TestSprites/environmentArt4"), new Vector2(4096 + 2048, 0));
            //fg.origin = Vector2.Zero;
            //gsPlay.tileList.Add(fg);

            //fg = new SpriteIMG(gsPlay.LoadTexture("TestSprites/environmentArt5"), new Vector2(4096 + 4096, 0));
            //fg.origin = Vector2.Zero;
            //gsPlay.tileList.Add(fg);

            //fg = new SpriteIMG(gsPlay.LoadTexture("TestSprites/environmentArt0"), new Vector2(-512, 0));
            //fg.origin = Vector2.Zero;
            //gsPlay.tileList.Add(fg);

            //ParticleEmitter pe = gsPlay.AddEmitter(new AnimatedSprite(gsPlay.LoadTexture("TestSprites/puff")), GridToPosition(157, 15));
            //pe.speed = new Vector2(1, 0);

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

            Door dooor = gsPlay.AddOpeningDoor(Art.door, GridToPosition(36, 30), GridToPosition(36, 34), OpenState.Closed);
            FlipSwitch fs1 = gsPlay.AddSwitch(new EventTrigger(this, dooor), gsPlay.LoadTexture("TestSprites/switch"), GridToPosition(29, 35));
            fs1.SetPlayerMode(PlayerObjectMode.Two);
            LightningChain lc1 = gsPlay.AddLightning(GridToPosition(29, 35), dooor.position, Color.Green);
            lc1.ConvertEndPointToTarget(dooor);
            fs1.AddEvent(new EventTrigger(this, lc1));

            CircularPlatform cp1 = gsPlay.AddCircularPlatform(Art.platform, GridToPosition(36, 45), 100, 240);
            gsPlay.AddSwitch(new EventTrigger(this, cp1), gsPlay.LoadTexture("TestSprites/switch"), GridToPosition(42, 48));
               // LightningChain lc2 = new LightningChain(GridToPosition(42, 48), Vector2.Zero, Color.Green);
            LightningChain lc2 = gsPlay.AddLightning(GridToPosition(42, 48), Vector2.Zero, Color.Green);
            lc2.ConvertEndPointToTarget(cp1);
            lc2.SetActive(true);

            gsPlay.AddPointLight(gsPlay.LoadTexture("ShaderAssets/pointLight"), GridToPosition(30, 47), new Vector2(3));
            player1Light = gsPlay.AddPointLight(gsPlay.LoadTexture("ShaderAssets/pointLight"), Vector2.Zero, new Vector2(2));
            player1Light.SetGlowing(2, 2.4f, 120);
            player2Light = gsPlay.AddPointLight(gsPlay.LoadTexture("ShaderAssets/pointLight"), Vector2.Zero, new Vector2(2));
            player2Light.SetGlowing(2, 2.4f, 120);

            LightConsole console1 = gsPlay.AddLightConsole(gsPlay.LoadTexture("TestSprites/LightConsole"), GridToPosition(189, 39));
            console1.AddLight(player1Light);
            LightConsole console2 = gsPlay.AddLinkedLightConsole(console1, console1.texture, GridToPosition(189, 32));
            console2.AddLight(player2Light);
            LightningChain consoleLightning = gsPlay.AddLightning(GridToPosition(189, 39), GridToPosition(189, 32), Color.White);
            consoleLightning.SetActive(true);
            console1.AddEvent(new EventTrigger(this, consoleLightning));
            console2.AddEvent(new EventTrigger(this, consoleLightning));

            console1 = gsPlay.AddLightConsole(console1.texture, GridToPosition(220, 17));

            gsPlay.AddBouncyBall(.5f, gsPlay.LoadTexture("TestSprites/pickUp"), GridToPosition(new Point(137, 46))).selfIlluminating = true;
            gsPlay.AddBouncyBall(.5f, gsPlay.LoadTexture("TestSprites/pickUp"), Level.GridToPosition(new Point(75, 16))).selfIlluminating = true;

            MovingPlatform m1 = gsPlay.AddActivatePlatform(Art.platform, Level.GridToPosition(new Point(94, 44)), Level.GridToPosition(new Point(112, 44)));
            m1.duration = 480;
            Button bb1 = gsPlay.AddButton(new EventTrigger(this, m1), 1, gsPlay.LoadTexture("TestSprites/button"), Level.GridToPosition(new Point(88, 45)));
            LightningChain lc3 = gsPlay.AddLightning(GridToPosition(88, 45), GridToPosition(88, 46) + new Vector2(0, 16), Color.Green);
            lc3.AddVertex(GridToPosition(103, 46) + new Vector2(0, 16));
            lc3.AddVertex(Vector2.Zero);
            lc3.ConvertEndPointToTarget(m1);
            bb1.AddEvent(new EventTrigger(this, lc3));

            Door d1 = gsPlay.AddOpeningDoor(Art.platform, GridToPosition(new Point(152, 41)) + new Vector2(16, 16), GridToPosition(new Point(149, 41)) + new Vector2(16, 16), OpenState.Closed);

            EventTrigger e1 = new EventTrigger(this, d1);
            e1.eventID = 9;
            TimerObject t1 = gsPlay.AddTimer(e1, 240);
            timedSwitch = gsPlay.AddSwitch(new EventTrigger(this, t1), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(147, 35)));
            timedSwitch.onlyTriggered = true;

            d1 = gsPlay.AddFadingDoor(Art.platform, GridToPosition(new Point(157, 36)) + new Vector2(16,16), OpenState.Closed);
            d1.traceID = 99;
            gsPlay.AddButton(new EventTrigger(this, d1), 1, gsPlay.LoadTexture("TestSprites/button"), GridToPosition(new Point(162, 44)));
            //d1 = gsPlay.AddOpeningDoor(gsPlay.LoadTexture("TestSprites/doorThick"), GridToPosition(new Point(191, 31)), GridToPosition(new Point(191, 31)), OpenState.Open);
            //d1.SetPlayerMode(PlayerObjectMode.Two);
            //d1.visible = false;
            //d1 = gsPlay.AddOpeningDoor(gsPlay.LoadTexture("TestSprites/doorThick"), GridToPosition(new Point(191, 38)), GridToPosition(new Point(191, 38)), OpenState.Open);
            //d1.SetPlayerMode(PlayerObjectMode.Two);
            //d1.visible = false;

            //Door d2 = gsPlay.AddFadingDoor(Art.door, GridToPosition(191, 31), OpenState.Closed);
            ////gsPlay.AddTriggerArea(new EventTrigger(this, d2), gsPlay.LoadTexture("TestSprites/switch"), GridToPosition(187, 39)).traceID = 27;
            //FlipSwitch fs1 = gsPlay.AddSwitch(new EventTrigger(this, d2), gsPlay.LoadTexture("TestSprites/switch"), GridToPosition(187, 39));
            //fs1.pressureCooker = true;

            d1 = gsPlay.AddFadingDoor(Art.door, GridToPosition(204, 38), OpenState.Closed);
            gsPlay.AddButton(new EventTrigger(this, d1), 1, gsPlay.LoadTexture("TestSprites/button"), GridToPosition(200, 33));
            d1 = gsPlay.AddFadingDoor(Art.door, GridToPosition(204, 31), OpenState.Closed);
            gsPlay.AddButton(new EventTrigger(this, d1), 1, gsPlay.LoadTexture("TestSprites/button"), GridToPosition(209, 40));
            d1 = gsPlay.AddFadingDoor(Art.door, GridToPosition(217, 38), OpenState.Closed);
            gsPlay.AddButton(new EventTrigger(this, d1), 1, gsPlay.LoadTexture("TestSprites/button"), GridToPosition(213, 33));
            d1 = gsPlay.AddFadingDoor(Art.door, GridToPosition(217, 31), OpenState.Closed);
            gsPlay.AddButton(new EventTrigger(this, d1), 1, gsPlay.LoadTexture("TestSprites/button"), GridToPosition(222, 40));

            //gsPlay.AddBouncyBall(.5f, gsPlay.LoadTexture("TestSprites/pickUp"), GridToPosition(new Point(175, 24)));

            gsPlay.AddMoveable(gsPlay.LoadTexture("TestSprites/moveable"), Level.GridToPosition(new Point(168, 2)), .8f);
            gsPlay.AddMoveable(gsPlay.LoadTexture("TestSprites/moveable"), Level.GridToPosition(new Point(177, 25)), .8f);
            gsPlay.AddMoveable(gsPlay.LoadTexture("TestSprites/moveable"), Level.GridToPosition(new Point(26, 47)), .8f);

            item1 = new InventoryItem(gsPlay.LoadTexture("TestSprites/item1"));
            itemList.Add(item1);
            item1Area = gsPlay.AddTriggerArea(new EventTrigger(this, 1), item1.itemImage.texture, GridToPosition(3, 25));
            item1Area.selfIlluminating = true;
            item2 = new InventoryItem(gsPlay.LoadTexture("TestSprites/item2"));
            itemList.Add(item2);
            item2Area = gsPlay.AddTriggerArea(new EventTrigger(this, 2), item2.itemImage.texture, GridToPosition(248, 2));
            item2Area.selfIlluminating = true;
            item3 = new InventoryItem(gsPlay.LoadTexture("TestSprites/item3"));
            itemList.Add(item3);
            item3Area = gsPlay.AddTriggerArea(new EventTrigger(this, 3), item3.itemImage.texture, GridToPosition(227, 31));
            item3Area.selfIlluminating = true;
            //gsPlay.AddMoveable(gsPlay.LoadTexture("TestSprites/moveable"), Level.GridToPosition(new Point(54, 27)), .8f);
            //gsPlay.AddMoveable(gsPlay.LoadTexture("TestSprites/moveable"), Level.GridToPosition(new Point(45, 27)), .8f);
            //gsPlay.AddMoveable(gsPlay.LoadTexture("TestSprites/moveable"), Level.GridToPosition(new Point(69, 12)), .8f);
            //gsPlay.AddPlatform(Art.platform, Level.GridToPosition(new Point(41, 16)), Level.GridToPosition(new Point(50, 16)));

            finalDoor = gsPlay.AddFadingDoor(Art.platform, GridToPosition(207, 13) + new Vector2(16, 16), OpenState.Closed);
            //gsPlay.AddSwitch(new EventTrigger(this, gsPlay.AddEventPlatform(Art.platform, Level.GridToPosition(new Point(93, 26)), Level.GridToPosition(new Point(100, 26)))), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(88, 28)));
            //gsPlay.AddTriggerArea(new EventTrigger(this, 0), gsPlay.LoadTexture("TestSprites/LightConsole"), Level.GridToPosition(new Point(207, 11)) + new Vector2(16,16));

            final1 = gsPlay.AddTriggerArea(new EventTrigger(this, 5), gsPlay.LoadTexture("TestSprites/lock1"), GridToPosition(202, 16) + new Vector2(16, 16));
            final1.SetAnimationStuff(1, 2, 1, 2, 64, 64, 2, 5);
            final1.isAnimating = false;
            final2 = gsPlay.AddTriggerArea(new EventTrigger(this, 6), gsPlay.LoadTexture("TestSprites/lock2"), GridToPosition(207, 16) + new Vector2(16, 16));
            final2.SetAnimationStuff(1, 2, 1, 2, 64, 64, 2, 5);
            final2.isAnimating = false;
            final3 = gsPlay.AddTriggerArea(new EventTrigger(this, 7), gsPlay.LoadTexture("TestSprites/lock3"), GridToPosition(212, 16) + new Vector2(16, 16));
            final3.SetAnimationStuff(1, 2, 1, 2, 64, 64, 2, 5);
            final3.isAnimating = false;
        }