public Level1(GSPlay gsPlay) : base(gsPlay) { levelDataTexture = gsPlay.LoadTexture("Levels/level1Data"); player1Pos = GridToPosition(42, 25); player2Pos = GridToPosition(40, 25); //player1Pos = GridToPosition(673, 20); //player2Pos = player1Pos; portalPos = GridToPosition(681, 20); pItemPos = GridToPosition(672, 11); SetupLevel(); leftLimit = 32; rightLimit = levelWidth - 32; gsPlay.cameraPlayer1.Update(); gsPlay.cameraPlayer2.Update(); gsPlay.cameraPlayer1.SnapToTarget(); gsPlay.cameraPlayer2.SnapToTarget(); //Deactivate players for intro scene: StartIntro(); Vector2 bgPosition = new Vector2(-500, -500); for (int x = 0; x < 34; x++) { SpriteIMG bg1 = new SpriteIMG(gsPlay.LoadTexture("BGs/fieldBackdropBase1"), bgPosition); bg1.SetPlayerMode(PlayerObjectMode.One); gsPlay.AddParallax(bg1, .1f); SpriteIMG bg2 = new SpriteIMG(gsPlay.LoadTexture("BGs/fieldBackdropBase2"), bgPosition); bg2.SetPlayerMode(PlayerObjectMode.Two); gsPlay.AddParallax(bg2, .1f); bgPosition.X += 1024; } bgPosition = new Vector2(-800, -500); for (int x = 0; x < 6; x++) { SpriteIMG bg1 = new SpriteIMG(gsPlay.LoadTexture("BGs/fieldBackdropOverlay1"), bgPosition); bg1.SetPlayerMode(PlayerObjectMode.One); gsPlay.AddParallax(bg1, .2f); SpriteIMG bg2 = new SpriteIMG(gsPlay.LoadTexture("BGs/fieldBackdropOverlay2"), bgPosition); bg2.SetPlayerMode(PlayerObjectMode.Two); gsPlay.AddParallax(bg2, .2f); bgPosition.X += 1024; } bgPosition = new Vector2(-300, -300); for (int x = 0; x < 11; x++) { SpriteIMG bg1 = new SpriteIMG(gsPlay.LoadTexture("BGs/fieldMatte1"), bgPosition); bg1.SetPlayerMode(PlayerObjectMode.One); gsPlay.AddParallax(bg1, .5f); SpriteIMG bg2 = new SpriteIMG(gsPlay.LoadTexture("BGs/fieldMatte2"), bgPosition); bg2.SetPlayerMode(PlayerObjectMode.Two); gsPlay.AddParallax(bg2, .5f); bgPosition.X += 1024; } //672, 13 gsPlay.AddBGWarmGear(gsPlay.LoadTexture("GameObjects/gearWarm3"), GridToCenterPosition(672, 13), .75f, .02f, 1); gsPlay.AddBGCoolGear(gsPlay.LoadTexture("GameObjects/gearCool3"), GridToCenterPosition(672, 13), .75f, .02f, 1); for (int x = 1; x <= 22; x++) { for (int y = 1; y <= 1; y++) { string fgName = "LevelTiles/Field/fieldCoolFG" + 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; fg.SetPlayerMode(PlayerObjectMode.Two); } string bgName = "LevelTiles/Field/fieldCoolBG" + 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 <= 22; x++) { for (int y = 1; y <= 1; y++) { string fgName = "LevelTiles/Field/fieldWarmFG" + 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; fg.SetPlayerMode(PlayerObjectMode.One); } string bgName = "LevelTiles/Field/fieldWarmBG" + 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); } } } TriggerArea update = gsPlay.AddTriggerArea(new EventTrigger(this, 99), Art.barrier, Vector2.Zero); atmosphereLight = new Color(255, 255, 255); doubleButtonDoor = gsPlay.AddOpeningDoor(Art.door, Level.GridToPosition(new Point(214, 23)), Level.GridToPosition(new Point(214, 27)), OpenState.Closed); //first door puzzle Button b1 = gsPlay.AddButton(new EventTrigger(this, 1), 1, gsPlay.LoadTexture("TestSprites/button"), Level.GridToPosition(new Point(206, 29))); //first door puzzle Button b2 = gsPlay.AddButton(new EventTrigger(this, 2), 1, gsPlay.LoadTexture("TestSprites/button"), Level.GridToPosition(new Point(222, 29))); //first door puzzle LightningChain lc1 = gsPlay.AddLightning(b1.position, doubleButtonDoor.position, Color.Green); lc1.ConvertEndPointToTarget(doubleButtonDoor); b1.AddEvent(new EventTrigger(this, lc1)); LightningChain lc2 = gsPlay.AddLightning(b2.position, doubleButtonDoor.position, Color.Green); lc2.ConvertEndPointToTarget(doubleButtonDoor); b2.AddEvent(new EventTrigger(this, lc2)); //lc3.AddVertex(GridToPosition(103, 46) + new Vector2(0, 16)); //gsPlay.AddBouncyBall(.5f, gsPlay.LoadTexture("TestSprites/pickUp"), Level.GridToPosition(new Point(222, 16))); Door d2 = gsPlay.AddOpeningDoor(Art.door, Level.GridToPosition(new Point(305, 23)), Level.GridToPosition(new Point(305, 27)), OpenState.Closed); //jump from box, ball on button Button b3 = gsPlay.AddButton(new EventTrigger(this, d2), 1, gsPlay.LoadTexture("TestSprites/button"), Level.GridToPosition(new Point(297, 29))); //jump from box, ball on button gsPlay.AddMoveable(gsPlay.LoadTexture("TestSprites/moveable"), Level.GridToPosition(new Point(257, 16)), .8f); //jump from box, ball on button gsPlay.AddBouncyBall(.5f, gsPlay.LoadTexture("TestSprites/pickUp"), Level.GridToPosition(new Point(280, 16))); //jump from box, ball on button LightningChain lc3 = gsPlay.AddLightning(b3.position, d2.position, Color.Green); lc3.ConvertEndPointToTarget(d2); b3.AddEvent(new EventTrigger(this, lc3)); Door d3 = gsPlay.AddOpeningDoor(Art.door, Level.GridToPosition(new Point(329, 23)), Level.GridToPosition(new Point(329, 27)), OpenState.Closed); //throw ball onto button gsPlay.AddBouncyBall(.5f, gsPlay.LoadTexture("TestSprites/pickUp"), Level.GridToPosition(new Point(312, 16))); //throw ball onto button Button b4 = gsPlay.AddButton(new EventTrigger(this, d3), 1, gsPlay.LoadTexture("TestSprites/button"), Level.GridToPosition(new Point(326, 22))); //throw ball onto button LightningChain lc4 = gsPlay.AddLightning(b4.position, d3.position, Color.Green); lc4.ConvertEndPointToTarget(d3); b4.AddEvent(new EventTrigger(this, lc4)); Door d4 = gsPlay.AddOpeningDoor(Art.door, Level.GridToPosition(new Point(373, 23)), Level.GridToPosition(new Point(373, 27)), OpenState.Closed); //box drop gsPlay.AddMoveable(gsPlay.LoadTexture("TestSprites/moveable"), Level.GridToPosition(new Point(339, 16)), .8f); //box drop gsPlay.AddBouncyBall(.8f, gsPlay.LoadTexture("TestSprites/pickUp"), Level.GridToPosition(new Point(358, 16))); //box drop Button b5 = gsPlay.AddButton(new EventTrigger(this, d4), 2, gsPlay.LoadTexture("TestSprites/button"), Level.GridToPosition(new Point(365, 29))); //box drop gsPlay.AddBouncyBall(.5f, gsPlay.LoadTexture("TestSprites/pickUp"), Level.GridToPosition(new Point(370, 16))); //box drop gsPlay.AddPlatform(Art.platform, Level.GridToPosition(new Point(351, 21)), Level.GridToPosition(new Point(346, 21))); //box drop LightningChain lc5 = gsPlay.AddLightning(b5.position, d4.position, Color.Green); lc5.ConvertEndPointToTarget(d4); b5.AddEvent(new EventTrigger(this, lc5)); gsPlay.AddMoveable(gsPlay.LoadTexture("TestSprites/moveable"), Level.GridToPosition(new Point(378, 16)), .8f); //box accross moving gsPlay.AddPlatform(Art.platform, Level.GridToPosition(new Point(398, 25)), Level.GridToPosition(new Point(406, 25))); //box accross moving gsPlay.AddPlatform(Art.platform, Level.GridToPosition(new Point(386, 25)), Level.GridToPosition(new Point(386, 30))); //box accross moving Door d5 = gsPlay.AddFadingDoor(Art.door, Level.GridToPosition(new Point(561, 24)), OpenState.Closed); //barn door FlipSwitch s1 = gsPlay.AddOnSwitch(new EventTrigger(this, d5), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(556, 25))); //barn door LightningChain lc6 = gsPlay.AddLightning(s1.position, GridToPosition(556, 26) + new Vector2(0, 16), Color.Green); lc6.AddVertex(GridToPosition(561, 26) + new Vector2(0, 16)); lc6.AddVertex(GridToPosition(561, 26) + new Vector2(0, 0)); //lc6.ConvertEndPointToTarget(d5); s1.AddEvent(new EventTrigger(this, lc6)); lc6.defaultActive = true; lc6.SetActive(true); Door d6 = gsPlay.AddOpeningDoor(Art.door, Level.GridToPosition(new Point(570, 15)), Level.GridToPosition(new Point(570, 23)), OpenState.Closed); Button b6 = gsPlay.AddButton(new EventTrigger(this, d6), 1, gsPlay.LoadTexture("TestSprites/button"), Level.GridToPosition(new Point(573, 19))); gsPlay.AddBouncyBall(.5f, gsPlay.LoadTexture("TestSprites/pickUp"), Level.GridToPosition(new Point(564, 24))); LightningChain lc7 = gsPlay.AddLightning(b6.position, d6.position, Color.Green); lc7.ConvertEndPointToTarget(d6); b6.AddEvent(new EventTrigger(this, lc7)); Door d7 = gsPlay.AddOpeningDoor(Art.door, Level.GridToPosition(new Point(576, 23)), Level.GridToPosition(new Point(576, 17)), OpenState.Closed); Button b7 = gsPlay.AddButton(new EventTrigger(this, d7), 1, gsPlay.LoadTexture("TestSprites/button"), Level.GridToPosition(new Point(579, 19))); LightningChain lc8 = gsPlay.AddLightning(b7.position, d7.position, Color.Green); lc8.ConvertEndPointToTarget(d7); b7.AddEvent(new EventTrigger(this, lc8)); gsPlay.AddMoveable(gsPlay.LoadTexture("TestSprites/moveable"), Level.GridToPosition(new Point(579, 22)), .8f); //gsPlay.AddPlatform(Art.platform, Level.GridToPosition(new Point(635, 06)), Level.GridToPosition(new Point(635, 25))); MovingPlatform p1 = gsPlay.AddReversePlatform(Art.platform, Level.GridToPosition(new Point(595, 06)), Level.GridToPosition(new Point(595, 25))); FlipSwitch s2 = gsPlay.AddSwitch(new EventTrigger(this, p1), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(602, 25))); LightningChain lc9 = gsPlay.AddLightning(s2.position, GridToPosition(595, 25), Color.Green); lc9.AddVertex(p1.position); lc9.ConvertEndPointToTarget(p1); s2.AddEvent(new EventTrigger(this, lc9)); Door d8 = gsPlay.AddFadingDoor(Art.door, Level.GridToPosition(new Point(605, 18)), OpenState.Closed); //lower barn exit FlipSwitch s3 = gsPlay.AddOnSwitch(new EventTrigger(this, d8), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(601, 19))); //lower barn exit LightningChain lc10 = gsPlay.AddLightning(s3.position, GridToPosition(601, 20) + new Vector2(0, 16), Color.Green); lc10.AddVertex(GridToPosition(605, 20) + new Vector2(0, 16)); lc10.AddVertex(GridToPosition(605, 20) + new Vector2(0, 0)); //lc6.ConvertEndPointToTarget(d5); s3.AddEvent(new EventTrigger(this, lc10)); lc10.defaultActive = true; lc10.SetActive(true); finalTrapDoor = gsPlay.AddOpeningDoor(Art.door, Level.GridToPosition(new Point(600, 28)), Level.GridToPosition(new Point(600, 24)), OpenState.Closed); Button finalButton = gsPlay.AddButton(new EventTrigger(this, finalTrapDoor), 2, gsPlay.LoadTexture("TestSprites/button"), Level.GridToPosition(new Point(591, 26))); LightningChain lc11 = gsPlay.AddLightning(finalButton.position, GridToPosition(600, 26), Color.Green); lc11.AddVertex(finalTrapDoor.position); lc11.ConvertEndPointToTarget(finalTrapDoor); finalButton.AddEvent(new EventTrigger(this, lc11)); finalTopDoor = gsPlay.AddFadingDoor(Art.door, Level.GridToPosition(new Point(605, 09)), OpenState.Closed); //upper barn exit FlipSwitch finalSwitch = gsPlay.AddOnSwitch(new EventTrigger(this, finalTopDoor), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(601, 10))); //upper barn exit finalSwitch.AddEvent(new EventTrigger(this, 4)); LightningChain lc12 = gsPlay.AddLightning(finalSwitch.position, GridToPosition(601, 11) + new Vector2(0, 16), Color.Green); lc12.AddVertex(GridToPosition(605, 11) + new Vector2(0, 16)); lc12.AddVertex(GridToPosition(605, 11) + new Vector2(0, 0)); //lc6.ConvertEndPointToTarget(d5); finalSwitch.AddEvent(new EventTrigger(this, lc12)); lc12.defaultActive = true; lc12.SetActive(true); AudioManager.PlayMusic("Field"); }
public Level3(GSPlay gsPlay) : base(gsPlay) { levelDataTexture = gsPlay.LoadTexture("Levels/level3Data"); player1Pos = GridToPosition(23, 150); player2Pos = GridToPosition(20, 150); //player1Pos = GridToPosition(147, 100); //player2Pos = player1Pos; portalPos = GridToPosition(492, 32); pItemPos = GridToPosition(152, 90) + new Vector2(-16, 0); renderCollision = false; SetupLevel(); for (int x = 1; x <= 17; x++) { for (int y = 1; y <= 6; y++) { string fgName = "LevelTiles/Mountain/mountainCoolFG" + y + "x" + x; 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; fg.SetPlayerMode(PlayerObjectMode.Two); } string bgName = "LevelTiles/Mountain/mountainCoolBG" + y + "x" + x; 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 <= 17; x++) { for (int y = 1; y <= 6; y++) { string fgName = "LevelTiles/Mountain/mountainWarmFG" + y + "x" + x; 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; fg.SetPlayerMode(PlayerObjectMode.One); } string bgName = "LevelTiles/Mountain/mountainWarmBG" + y + "x" + x; 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, -400); for (int x = 0; x < 3; x++) { for (int y = 0; y < 2; y++) { SpriteIMG bg1 = new SpriteIMG(gsPlay.LoadTexture("BGs/mountainBackdropBase1"), bgPosition); bg1.SetPlayerMode(PlayerObjectMode.One); gsPlay.AddParallax(bg1, .1f); SpriteIMG bg2 = new SpriteIMG(gsPlay.LoadTexture("BGs/mountainBackdropBase2"), bgPosition); bg2.SetPlayerMode(PlayerObjectMode.Two); gsPlay.AddParallax(bg2, .1f); bgPosition.Y += 1024; } bgPosition.Y = -400; bgPosition.X += 1024; } bgPosition = new Vector2(-300, -300); for (int x = 0; x < 4; x++) { for (int y = 0; y < 2; y++) { SpriteIMG bg1 = new SpriteIMG(gsPlay.LoadTexture("BGs/mountainBackdropOverlay1"), bgPosition); bg1.SetPlayerMode(PlayerObjectMode.One); gsPlay.AddParallax(bg1, .2f); SpriteIMG bg2 = new SpriteIMG(gsPlay.LoadTexture("BGs/mountainBackdropOverlay2"), bgPosition); bg2.SetPlayerMode(PlayerObjectMode.Two); gsPlay.AddParallax(bg2, .2f); bgPosition.Y += 1024; } bgPosition.Y = -300; bgPosition.X += 1024; } bgPosition = new Vector2(-300, -300); for (int x = 0; x < 9; x++) { for (int y = 0; y < 3; y++) { SpriteIMG bg1 = new SpriteIMG(gsPlay.LoadTexture("BGs/mountainMatte1"), bgPosition); bg1.SetPlayerMode(PlayerObjectMode.One); gsPlay.AddParallax(bg1, .5f); SpriteIMG bg2 = new SpriteIMG(gsPlay.LoadTexture("BGs/mountainMatte2"), bgPosition); bg2.SetPlayerMode(PlayerObjectMode.Two); gsPlay.AddParallax(bg2, .5f); bgPosition.Y += 1024; } bgPosition.Y = -300; bgPosition.X += 1024; } gsPlay.AddBGWarmGear(gsPlay.LoadTexture("GameObjects/gearWarm2"), GridToCenterPosition(149, 72), .75f, -.02f, 1); gsPlay.AddBGCoolGear(gsPlay.LoadTexture("GameObjects/gearCool2"), GridToCenterPosition(149, 72), .75f, -.02f, 1); gsPlay.AddBGWarmGear(gsPlay.LoadTexture("GameObjects/gearWarm1"), GridToCenterPosition(153, 77), 1f, .015f, 1); gsPlay.AddBGCoolGear(gsPlay.LoadTexture("GameObjects/gearCool1"), GridToCenterPosition(153, 77), 1f, .015f, 1); gsPlay.AddBGWarmGear(gsPlay.LoadTexture("GameObjects/gearWarm3"), GridToCenterPosition(149, 82), 1.25f, -.01f, 1); gsPlay.AddBGCoolGear(gsPlay.LoadTexture("GameObjects/gearCool3"), GridToCenterPosition(149, 82), 1.25f, -.01f, 1); //part1 Door d1 = gsPlay.AddFadingDoor(Art.door, GridToPosition(new Point(137, 101)) + new Vector2(-16, 0), OpenState.Closed); FlipSwitch s1 = gsPlay.AddOnSwitch(new EventTrigger(this, d1), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(144, 111))); s1.SetPlayerMode(PlayerObjectMode.Two); Door bd1 = gsPlay.AddFadingDoor(Art.door, GridToPosition(new Point(137, 101)) + new Vector2(-16, 0), OpenState.Closed); bd1.SetPlayerMode(PlayerObjectMode.Two); LightningChain lc1 = gsPlay.AddLightning(s1.position, s1.position + new Vector2(0, -240), Color.LightBlue); 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.platform, GridToPosition(new Point(157, 107)) + new Vector2(-16, -16), OpenState.Closed); FlipSwitch s2 = gsPlay.AddOnSwitch(new EventTrigger(this, d2), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(148, 101))); s2.SetPlayerMode(PlayerObjectMode.One); Door bd2 = gsPlay.AddFadingDoor(Art.platform, GridToPosition(new Point(157, 107)) + new Vector2(-16, -16), OpenState.Closed); bd2.SetPlayerMode(PlayerObjectMode.One); LightningChain lc2 = gsPlay.AddLightning(s2.position, s2.position + new Vector2(0, 80), Color.Red); lc2.AddVertex(s2.position + new Vector2(96, 80)); lc2.AddVertex(d2.position + new Vector2(-80, 0)); lc2.AddVertex(d2.position + new Vector2(-48, 0)); s2.AddEvent(new EventTrigger(this, lc2)); lc2.defaultActive = true; lc2.SetActive(true); //part2 Door d3 = gsPlay.AddFadingDoor(Art.door, GridToPosition(new Point(249, 87)), OpenState.Closed); FlipSwitch s3 = gsPlay.AddSwitch(new EventTrigger(this, d3), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(247, 88)) + new Vector2(-16, 0)); s3.SetPlayerMode(PlayerObjectMode.Two); Door bd3 = gsPlay.AddFadingDoor(Art.door, GridToPosition(new Point(249, 87)), OpenState.Closed); bd3.SetPlayerMode(PlayerObjectMode.Two); LightningChain lc3 = gsPlay.AddLightning(s3.position, d3.position, Color.Orange); s3.AddEvent(new EventTrigger(this, lc3)); Door d4 = gsPlay.AddFadingDoor(Art.platform, GridToPosition(new Point(247, 85)) + new Vector2(-16, -16), OpenState.Closed); FlipSwitch s4 = gsPlay.AddSwitch(new EventTrigger(this, d4), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(252, 88)) + new Vector2(-16, 0)); s2.SetPlayerMode(PlayerObjectMode.One); Door bd4 = gsPlay.AddFadingDoor(Art.platform, GridToPosition(new Point(247, 85)) + new Vector2(-16, -16), OpenState.Closed); bd4.SetPlayerMode(PlayerObjectMode.One); lc3.AddVertex(s4.position); LightningChain lc4 = gsPlay.AddLightning(s4.position, d4.position, Color.Orange); s4.AddEvent(new EventTrigger(this, lc4)); Door d5 = gsPlay.AddFadingDoor(Art.platform, GridToPosition(new Point(252, 85)) + new Vector2(-16, -16), OpenState.Closed); FlipSwitch s5 = gsPlay.AddSwitch(new EventTrigger(this, d5), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(247, 82)) + new Vector2(-16, 0)); lc4.AddVertex(s5.position); LightningChain lc5 = gsPlay.AddLightning(s5.position, d5.position, Color.Orange); s5.AddEvent(new EventTrigger(this, lc5)); Door d6 = gsPlay.AddFadingDoor(Art.platform, GridToPosition(new Point(247, 80)) + new Vector2(-16, -16), OpenState.Closed); FlipSwitch s6 = gsPlay.AddSwitch(new EventTrigger(this, d6), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(252, 78)) + new Vector2(-16, 0)); lc5.AddVertex(s6.position); LightningChain lc6 = gsPlay.AddLightning(s6.position, d6.position, Color.Orange); s6.AddEvent(new EventTrigger(this, lc6)); Door d7 = gsPlay.AddFadingDoor(Art.platform, GridToPosition(new Point(252, 76)) + new Vector2(-16, -16), OpenState.Closed); FlipSwitch s7 = gsPlay.AddSwitch(new EventTrigger(this, d7), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(247, 74)) + new Vector2(-16, 0)); lc6.AddVertex(s7.position); LightningChain lc7 = gsPlay.AddLightning(s7.position, d7.position, Color.Orange); s7.AddEvent(new EventTrigger(this, lc7)); Door d8 = gsPlay.AddFadingDoor(Art.platform, GridToPosition(new Point(247, 72)) + new Vector2(-16, -16), OpenState.Closed); FlipSwitch s8 = gsPlay.AddSwitch(new EventTrigger(this, d8), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(252, 70)) + new Vector2(-16, 0)); lc7.AddVertex(s8.position); LightningChain lc8 = gsPlay.AddLightning(s8.position, d8.position, Color.Orange); s8.AddEvent(new EventTrigger(this, lc8)); Door d9 = gsPlay.AddFadingDoor(Art.platform, GridToPosition(new Point(252, 68)) + new Vector2(-16, -16), OpenState.Closed); FlipSwitch s9 = gsPlay.AddSwitch(new EventTrigger(this, d9), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(247, 64)) + new Vector2(-16, 0)); lc8.AddVertex(s9.position); LightningChain lc9 = gsPlay.AddLightning(s9.position, d9.position, Color.Orange); s9.AddEvent(new EventTrigger(this, lc9)); //part3 Door d10 = gsPlay.AddFadingDoor(Art.door, GridToPosition(new Point(327, 68)) + new Vector2(-16, 0), OpenState.Closed); FlipSwitch s10 = gsPlay.AddSwitch(new EventTrigger(this, d10), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(330, 61))); d10.SetPlayerMode(PlayerObjectMode.One); s10.SetPlayerMode(PlayerObjectMode.Two); LightningChain lc10 = gsPlay.AddLightning(s10.position, d10.position, Color.Orange); s10.AddEvent(new EventTrigger(this, lc10)); Door d11 = gsPlay.AddFadingDoor(Art.door, GridToPosition(new Point(334, 62)) + new Vector2(-16, 0), OpenState.Closed); FlipSwitch s11 = gsPlay.AddSwitch(new EventTrigger(this, d11), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(337, 68))); d11.SetPlayerMode(PlayerObjectMode.Two); s11.SetPlayerMode(PlayerObjectMode.One); lc10.AddVertex(s11.position); LightningChain lc11 = gsPlay.AddLightning(s11.position, d11.position, Color.Orange); s11.AddEvent(new EventTrigger(this, lc11)); Door d12 = gsPlay.AddFadingDoor(Art.door, GridToPosition(new Point(341, 68)) + new Vector2(-16, 0), OpenState.Closed); FlipSwitch s12 = gsPlay.AddSwitch(new EventTrigger(this, d12), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(344, 61))); d12.SetPlayerMode(PlayerObjectMode.One); s12.SetPlayerMode(PlayerObjectMode.Two); lc11.AddVertex(s12.position); LightningChain lc12 = gsPlay.AddLightning(s12.position, d12.position, Color.Orange); s12.AddEvent(new EventTrigger(this, lc12)); Door d13 = gsPlay.AddFadingDoor(Art.door, GridToPosition(new Point(348, 62)) + new Vector2(-16, 0), OpenState.Closed); FlipSwitch s13 = gsPlay.AddSwitch(new EventTrigger(this, d13), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(351, 68))); d13.SetPlayerMode(PlayerObjectMode.Two); s13.SetPlayerMode(PlayerObjectMode.One); lc12.AddVertex(s13.position); LightningChain lc13 = gsPlay.AddLightning(s13.position, d13.position, Color.Orange); s13.AddEvent(new EventTrigger(this, lc13)); //part4 MovingPlatform mp1 = gsPlay.AddReversePlatform(Art.platform, Level.GridToPosition(new Point(399, 25)) + new Vector2(0, -16), Level.GridToPosition(new Point(407, 25)) + new Vector2(0, -16)); mp1.SetPlayerMode(PlayerObjectMode.One); FlipSwitch ms1 = gsPlay.AddSwitch(new EventTrigger(this, mp1), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(403, 29))); ms1.SetPlayerMode(PlayerObjectMode.Two); LightningChain lc114 = gsPlay.AddLightning(ms1.position, mp1.position, Color.LightBlue); lc114.ConvertEndPointToTarget(mp1); ms1.AddEvent(new EventTrigger(this, lc114)); Door d14 = gsPlay.AddFadingDoor(Art.door, GridToPosition(new Point(393, 9)) + new Vector2(-16, 0), OpenState.Closed); FlipSwitch s14 = gsPlay.AddSwitch(new EventTrigger(this, d14), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(398, 21))); LightningChain lc14 = gsPlay.AddLightning(s14.position, GridToPosition(393, 21), Color.Red); lc14.AddVertex(d14.position); s14.AddEvent(new EventTrigger(this, lc14)); Door d15 = gsPlay.AddFadingDoor(Art.platform, GridToPosition(new Point(366, 33)) + new Vector2(0, -16), OpenState.Closed); Button s15 = gsPlay.AddButton(new EventTrigger(this, d15), 1, gsPlay.LoadTexture("TestSprites/button"), GridToPosition(new Point(370, 32))); LightningChain lc15 = gsPlay.AddLightning(s15.position, GridToPosition(370, 33) + new Vector2(0, -16), Color.Orange); lc15.AddVertex(GridToPosition(367, 33) + new Vector2(0, -16)); s15.AddEvent(new EventTrigger(this, lc15)); lc15.defaultActive = true; lc15.SetActive(true); Door d16 = gsPlay.AddFadingDoor(Art.platform, GridToPosition(new Point(444, 69)) + new Vector2(0, -16), OpenState.Closed); FlipSwitch s16 = gsPlay.AddSwitch(new EventTrigger(this, d16), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(440, 71))); s16.SetPlayerMode(PlayerObjectMode.Two); LightningChain lc16 = gsPlay.AddLightning(s16.position, GridToPosition(440, 69) + new Vector2(0, -16), Color.Orange); lc16.AddVertex(GridToPosition(443, 69) + new Vector2(0, -16)); s16.AddEvent(new EventTrigger(this, lc16)); lc16.defaultActive = true; lc16.SetActive(true); gsPlay.AddBouncyBall(.5f, gsPlay.LoadTexture("TestSprites/pickUp"), GridToPosition(new Point(426, 68))).selfIlluminating = true; gsPlay.AddMoveable(gsPlay.LoadTexture("TestSprites/moveable"), Level.GridToPosition(new Point(429, 46)), .8f); gsPlay.AddMoveable(gsPlay.LoadTexture("TestSprites/moveable"), Level.GridToPosition(new Point(388, 10)), .8f); gsPlay.AddMoveable(gsPlay.LoadTexture("TestSprites/moveable"), Level.GridToPosition(new Point(366, 31)), .8f); gsPlay.AddMoveable(gsPlay.LoadTexture("TestSprites/moveable"), Level.GridToPosition(new Point(443, 71 )), .8f); //secret Door mp2 = gsPlay.AddFadingDoor(Art.platform, GridToPosition(new Point(152, 69)) + new Vector2(-16, -16), OpenState.Closed); FlipSwitch ms2 = gsPlay.AddSwitch(new EventTrigger(this, mp2), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(152, 67)) + new Vector2(-16, 0)); ms2.pressureCooker = true; ms2.SetPlayerMode(PlayerObjectMode.One); LightningChain lc17 = gsPlay.AddLightning(ms2.position, mp2.position + new Vector2(64, 0), Color.LightBlue); ms2.AddEvent(new EventTrigger(this, lc17)); Door mp3 = gsPlay.AddFadingDoor(Art.platform, GridToPosition(new Point(152, 69)) + new Vector2(-16, -16), OpenState.Closed); FlipSwitch ms3 = gsPlay.AddSwitch(new EventTrigger(this, mp3), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(152, 67)) + new Vector2(-16, 0)); ms3.pressureCooker = true; ms3.SetPlayerMode(PlayerObjectMode.Two); LightningChain lc18 = gsPlay.AddLightning(ms3.position, mp3.position + new Vector2(-64, 0), Color.Red); ms3.AddEvent(new EventTrigger(this, lc18)); Door bd5 = gsPlay.AddFadingDoor(Art.door, GridToPosition(new Point(150, 66)) + new Vector2(-16, 0), OpenState.Closed); bd5.SetPlayerMode(PlayerObjectMode.One); Door bd6 = gsPlay.AddFadingDoor(Art.door, GridToPosition(new Point(154, 66)) + new Vector2(-16, 0), OpenState.Closed); bd6.SetPlayerMode(PlayerObjectMode.Two); AudioManager.PlayMusic("Mountain"); }
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 Level7(GSPlay gsPlay) : base(gsPlay) { levelDataTexture = gsPlay.LoadTexture("Levels/level7Data"); player1Pos = GridToPosition(5, 280); player2Pos = GridToPosition(7, 280); //player1Pos = GridToPosition(430, 123); //player2Pos = player1Pos; portalPos = GridToPosition(394, 41); pItemPos = GridToPosition(441, 119); renderCollision = false; SetupLevel(); for (int x = 1; x <= 15; x++) { for (int y = 1; y <= 10; y++) { string bgName = "LevelTiles/Construction/constructionCoolBG" + y + "x" + x; 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 <= 15; x++) { for (int y = 1; y <= 10; y++) { string bgName = "LevelTiles/Construction/constructionWarmBG" + y + "x" + x; 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); } } } leftLimit = 32; rightLimit = levelWidth; Vector2 bgPosition = new Vector2(-400, -300); for (int x = 0; x < 3; x++) { for (int y = 0; y < 3; y++) { SpriteIMG bg1 = new SpriteIMG(gsPlay.LoadTexture("BGs/constructionBackdropBase1"), bgPosition); bg1.SetPlayerMode(PlayerObjectMode.One); gsPlay.AddParallax(bg1, .1f); SpriteIMG bg2 = new SpriteIMG(gsPlay.LoadTexture("BGs/constructionBackdropBase2"), bgPosition); bg2.SetPlayerMode(PlayerObjectMode.Two); gsPlay.AddParallax(bg2, .1f); bgPosition.Y += 1024; } bgPosition.X += 1024; bgPosition.Y = -300; } bgPosition = new Vector2(-300, -300); for (int x = 0; x < 4; x++) { for (int y = 0; y < 3; y++) { SpriteIMG bg1 = new SpriteIMG(gsPlay.LoadTexture("BGs/constructionBackdropOverlay1"), bgPosition); bg1.SetPlayerMode(PlayerObjectMode.One); gsPlay.AddParallax(bg1, .2f); SpriteIMG bg2 = new SpriteIMG(gsPlay.LoadTexture("BGs/constructionBackdropOverlay2"), bgPosition); bg2.SetPlayerMode(PlayerObjectMode.Two); gsPlay.AddParallax(bg2, .2f); bgPosition.Y += 1024; } bgPosition.Y = -300; bgPosition.X += 1024; } bgPosition = new Vector2(-512, -512); for (int x = 0; x < 8; x++) { for (int y = 0; y < 5; y++) { gsPlay.CreateGearMatte(bgPosition); bgPosition.Y += 1024; } bgPosition.X += 1024; bgPosition.Y = -512; } TriggerArea update = gsPlay.AddTriggerArea(new EventTrigger(this, 99), Art.smoke, Vector2.Zero); update.visible = false; Sprite cameraTarget = new Sprite(GridToPosition(239, 278)); gsPlay.cameraPlayer1.AddTarget(cameraTarget); gsPlay.cameraPlayer2.AddTarget(cameraTarget); SpriteIMG s = new SpriteIMG(gsPlay.LoadTexture("bgSky"), new Vector2(levelWidth / 2, levelHeight / 2)); gsPlay.AddParallax(s, .5f); atmosphereLight = new Color(100, 100, 100); Moveable m1 = gsPlay.AddMoveable(gsPlay.LoadTexture("TestSprites/moveable"), Level.GridToPosition(new Point(95, 280)), .8f); //box under backhoe Moveable m2 = gsPlay.AddMoveable(gsPlay.LoadTexture("TestSprites/moveable"), Level.GridToPosition(new Point(161, 290)), .8f); //box in pit under platform MovingPlatform underCrane = gsPlay.AddReversePlatform(Art.platform, Level.GridToPosition(new Point(153, 275)), Level.GridToPosition(new Point(153, 282))); FlipSwitch crane = gsPlay.AddSwitch(new EventTrigger(this, underCrane), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(126, 265))); //crane switch and platform LightningChain lc1 = gsPlay.AddLightning(crane.position, GridToPosition(130, 265), Color.Red); lc1.AddVertex(GridToPosition(137, 274)); lc1.AddVertex(GridToPosition(141, 274)); lc1.AddVertex(underCrane.position); lc1.ConvertEndPointToTarget(underCrane); crane.AddEvent(new EventTrigger(this, lc1)); gsPlay.AddMoveable(gsPlay.LoadTexture("TestSprites/moveable"), Level.GridToPosition(new Point(195, 278)), .8f); //box before saw machine gsPlay.AddPlatform(Art.platform, Level.GridToPosition(new Point(235, 277)), Level.GridToPosition(new Point(243, 277))); //platform over saw machine gsPlay.AddBouncyBall(0, gsPlay.LoadTexture("TestSprites/pickUp"), Level.GridToPosition(new Point(307, 286))); //ball under building Door leftBasement = gsPlay.AddOpeningDoor(Art.platform, Level.GridToPosition(new Point(313, 283)), Level.GridToPosition(new Point(309, 283)), OpenState.Closed); FlipSwitch s1 = gsPlay.AddSwitch(new EventTrigger(this, leftBasement), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(314, 281))); //first horiz door s1.SetPlayerMode(PlayerObjectMode.One); LightningChain lc2 = gsPlay.AddLightning(s1.position, leftBasement.position, Color.Red); lc2.ConvertEndPointToTarget(leftBasement); s1.AddEvent(new EventTrigger(this, lc2)); Door rightBasement = gsPlay.AddOpeningDoor(Art.platform, Level.GridToPosition(new Point(319, 283)), Level.GridToPosition(new Point(323, 283)), OpenState.Closed); FlipSwitch s2 = gsPlay.AddSwitch(new EventTrigger(this, rightBasement), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(322, 288))); //2nd horiz door s2.SetPlayerMode(PlayerObjectMode.Two); LightningChain lc3 = gsPlay.AddLightning(s2.position, rightBasement.position, Color.Red); lc3.ConvertEndPointToTarget(rightBasement); s2.AddEvent(new EventTrigger(this, lc3)); gsPlay.AddPlatform(Art.platform, Level.GridToPosition(new Point(290, 282)), Level.GridToPosition(new Point(290, 209))); //elevator Door d1 = gsPlay.AddFadingDoor(Art.door, Level.GridToPosition(new Point(332, 213)), OpenState.Closed); //door to let ball in FlipSwitch ballDoor = gsPlay.AddSwitch(new EventTrigger(this, d1), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(328, 208))); LightningChain lc4 = gsPlay.AddLightning(ballDoor.position, GridToPosition(328, 209) + new Vector2(0, 16), Color.Red); lc4.AddVertex(GridToPosition(332, 211) + new Vector2(0, -16)); lc4.AddVertex(GridToPosition(332, 211) + new Vector2(0, 0)); //lc6.ConvertEndPointToTarget(d5); ballDoor.AddEvent(new EventTrigger(this, lc4)); Door d2 = gsPlay.AddFadingDoor(Art.door, Level.GridToPosition(new Point(332, 207)), OpenState.Closed); //door opened by ball Button ballOn = gsPlay.AddButton(new EventTrigger(this, d2), 1, gsPlay.LoadTexture("TestSprites/button"), Level.GridToPosition(new Point(335, 216))); LightningChain lc5 = gsPlay.AddLightning(ballOn.position, GridToPosition(338, 216), Color.Red); lc5.AddVertex(GridToPosition(338, 210)); lc5.AddVertex(GridToPosition(332, 210)); lc5.AddVertex(GridToPosition(332, 209) + new Vector2(0, 0)); ballOn.AddEvent(new EventTrigger(this, lc5)); //338, 216 //338, 210 //332, 210 //332, 209 d3 = gsPlay.AddFadingDoor(Art.door, Level.GridToPosition(new Point(370, 207)), OpenState.Closed); //fading doors over pit d5 = gsPlay.AddFadingDoor(Art.door, Level.GridToPosition(new Point(376, 207)), OpenState.Open); FlipSwitch FS1 = gsPlay.AddMultiSwitch(new EventTrigger(this, 1), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(373, 202))); LightningChain lc6 = gsPlay.AddLightning(FS1.position, GridToPosition(370, 204) + new Vector2(0, 16), Color.Red); lc6.AddVertex(GridToPosition(370, 204) + new Vector2(0, 32)); FS1.AddEvent(new EventTrigger(this, lc6)); LightningChain lc7 = gsPlay.AddLightning(FS1.position, GridToPosition(376, 204) + new Vector2(0, 16), Color.Red); lc7.AddVertex(GridToPosition(376, 204) + new Vector2(0, 32)); FS1.AddEvent(new EventTrigger(this, lc7)); lc6.defaultActive = true; lc6.SetActive(true); MovingPlatform pitPlatform1 = gsPlay.AddReversePlatform(Art.platform, Level.GridToPosition(new Point(365, 210)), Level.GridToPosition(new Point(381, 210))); FlipSwitch pitPlatform1Switch = gsPlay.AddSwitch(new EventTrigger(this, pitPlatform1), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(364, 202))); //platform with fading doors 1 LightningChain lc8 = gsPlay.AddLightning(pitPlatform1Switch.position, GridToPosition(364, 210), Color.Red); lc8.AddVertex(pitPlatform1.position); lc8.ConvertEndPointToTarget(pitPlatform1); pitPlatform1Switch.AddEvent(new EventTrigger(this, lc8)); Door d4 = gsPlay.AddFadingDoor(Art.door, Level.GridToPosition(new Point(384, 201)), OpenState.Closed); //ease of access FlipSwitch easeOfAccess = gsPlay.AddOnSwitch(new EventTrigger(this, d4), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(384, 208))); LightningChain lc9 = gsPlay.AddLightning(easeOfAccess.position, GridToPosition(384, 203) + new Vector2(0, 16), Color.Red); lc9.AddVertex(GridToPosition(384, 203) + new Vector2(0, 0)); lc9.defaultActive = true; lc9.SetActive(true); easeOfAccess.AddEvent(new EventTrigger(this, lc9)); MovingPlatform toCrane2p = gsPlay.AddReversePlatform(Art.platform, Level.GridToPosition(new Point(384, 216)), Level.GridToPosition(new Point(360, 216))); FlipSwitch toCrane2s = gsPlay.AddSwitch(new EventTrigger(this, toCrane2p), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(393, 212))); //platform to crane 2 switch LightningChain lc10 = gsPlay.AddLightning(toCrane2s.position, GridToPosition(393, 216), Color.Red); lc10.AddVertex(GridToPosition(384, 216)); lc10.AddVertex(toCrane2p.position); lc10.ConvertEndPointToTarget(toCrane2p); toCrane2s.AddEvent(new EventTrigger(this, lc10)); //393, 216 //384, 216 MovingPlatform crane2 = gsPlay.AddReversePlatform(Art.platform, Level.GridToPosition(new Point(343, 198)), Level.GridToPosition(new Point(343, 206))); FlipSwitch crane2switch = gsPlay.AddSwitch(new EventTrigger(this, crane2), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(350, 214))); //crane 2 switch and platform LightningChain lc11 = gsPlay.AddLightning(crane2switch.position, GridToPosition(343, 214), Color.Red); lc11.AddVertex(crane2.position); lc11.ConvertEndPointToTarget(crane2); crane2switch.AddEvent(new EventTrigger(this, lc11)); MovingPlatform crane3 = gsPlay.AddReversePlatform(Art.platform, Level.GridToPosition(new Point(252, 185)), Level.GridToPosition(new Point(267, 185))); FlipSwitch crane3switch = gsPlay.AddSwitch(new EventTrigger(this, crane3), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToCenterPosition(new Point(259, 178)) + new Vector2(0, -16)); //crane 3 LightningChain lc12 = gsPlay.AddLightning(crane3switch.position, GridToCenterPosition(259,180), Color.Red); lc12.AddVertex(crane3.position); lc12.ConvertEndPointToTarget(crane3); crane3switch.AddEvent(new EventTrigger(this, lc12)); Door d6 = gsPlay.AddFadingDoor(Art.door, Level.GridToPosition(new Point(306, 177)), OpenState.Closed); FlipSwitch d6s = gsPlay.AddOnSwitch(new EventTrigger(this, d6), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(267, 183))); //door switch under crane 3 LightningChain lc13 = gsPlay.AddLightning(d6s.position, GridToPosition(282, 183), Color.Red); lc13.AddVertex(GridToPosition(282, 168)); lc13.AddVertex(GridToPosition(306, 168)); lc13.AddVertex(GridToPosition(306, 175)); d6s.AddEvent(new EventTrigger(this, lc13)); lc13.defaultActive = true; lc13.SetActive(true); //267, 185 //282, 185 //282, 168 //306, 168 //306, 175 d7 = gsPlay.AddFadingDoor(Art.door, Level.GridToPosition(new Point(315, 177)), OpenState.Closed); //multiple fading doors 1 d8 = gsPlay.AddFadingDoor(Art.door, Level.GridToPosition(new Point(321, 177)), OpenState.Closed); d9 = gsPlay.AddFadingDoor(Art.door, Level.GridToPosition(new Point(327, 177)), OpenState.Open); d10 = gsPlay.AddFadingDoor(Art.door, Level.GridToPosition(new Point(333, 177)), OpenState.Open); FlipSwitch FS2 = gsPlay.AddMultiSwitch(new EventTrigger(this, 2), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(321, 172))); FlipSwitch FS3 = gsPlay.AddMultiSwitch(new EventTrigger(this, 3), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(327, 172))); LightningChain lc14 = gsPlay.AddLightning(FS2.position, GridToPosition(315, 174) + new Vector2(0, 16), Color.Red); lc14.AddVertex(GridToPosition(315, 174) + new Vector2(0, 32)); FS2.AddEvent(new EventTrigger(this, lc14)); LightningChain lc15 = gsPlay.AddLightning(FS3.position, GridToPosition(321, 174) + new Vector2(0, 16), Color.Red); lc15.AddVertex(GridToPosition(321, 174) + new Vector2(0, 32)); FS3.AddEvent(new EventTrigger(this, lc15)); LightningChain lc16 = gsPlay.AddLightning(FS2.position, GridToPosition(327, 174) + new Vector2(0, 16), Color.Red); lc16.AddVertex(GridToPosition(327, 174) + new Vector2(0, 32)); FS2.AddEvent(new EventTrigger(this, lc16)); lc14.defaultActive = true; lc14.SetActive(true); LightningChain lc17 = gsPlay.AddLightning(FS3.position, GridToPosition(333, 174) + new Vector2(0, 16), Color.Red); lc17.AddVertex(GridToPosition(333, 174) + new Vector2(0, 32)); FS3.AddEvent(new EventTrigger(this, lc17)); lc15.defaultActive = true; lc15.SetActive(true); Door d11 = gsPlay.AddFadingDoor(Art.door, Level.GridToPosition(new Point(333, 171)), OpenState.Closed); FlipSwitch d11s = gsPlay.AddOnSwitch(new EventTrigger(this, d11), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(335, 178))); LightningChain lc18 = gsPlay.AddLightning(d11s.position, GridToPosition(333, 173) + new Vector2(0, 16), Color.Red); lc18.AddVertex(GridToPosition(333, 173) + new Vector2(0, 0)); d11s.AddEvent(new EventTrigger(this, lc18)); lc18.defaultActive = true; lc18.SetActive(true); gsPlay.AddCircularPlatform(Art.platform, Level.GridToPosition(new Point(275, 145)), 128, 240); //circular platform 1 CircularPlatform c1 = gsPlay.AddCircularPlatform(Art.platform, Level.GridToPosition(new Point(271, 137)), 128, 240); //circular platform 2 c1.increment = -c1.increment; gsPlay.AddCircularPlatform(Art.platform, Level.GridToPosition(new Point(275, 129)), 128, 240); //circular platform 3 gsPlay.AddPlatform(Art.platform, Level.GridToPosition(new Point(300, 126)), Level.GridToPosition(new Point(319, 126))); //slide under wind d12 = gsPlay.AddFadingDoor(Art.platform, Level.GridToPosition(new Point(341, 127)), OpenState.Closed); //fading platforms to portal item d13 = gsPlay.AddFadingDoor(Art.platform, Level.GridToPosition(new Point(354, 127)), OpenState.Open); FlipSwitch FS4 = gsPlay.AddMultiSwitch(new EventTrigger(this, 4), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToCenterPosition(new Point(347, 112)) + new Vector2(0, -16)); //multi-state! LightningChain lc19 = gsPlay.AddLightning(FS4.position, GridToCenterPosition(347, 114), Color.Red); lc19.AddVertex(d12.position); FS4.AddEvent(new EventTrigger(this, lc19)); LightningChain lc20 = gsPlay.AddLightning(FS4.position, GridToCenterPosition(347, 114), Color.Red); lc20.AddVertex(d13.position); FS4.AddEvent(new EventTrigger(this, lc20)); lc19.defaultActive = true; lc19.SetActive(true); Door d14 = gsPlay.AddFadingDoor(Art.door, Level.GridToPosition(new Point(356, 111)), OpenState.Closed); //ease of access FlipSwitch d14s = gsPlay.AddOnSwitch(new EventTrigger(this, d14), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(360, 124))); LightningChain lc21 = gsPlay.AddLightning(d14s.position, GridToPosition(356, 113) + new Vector2(0, 16), Color.Red); lc21.AddVertex(GridToPosition(356, 113) + new Vector2(0, 0)); d14s.AddEvent(new EventTrigger(this, lc21)); lc21.defaultActive = true; lc21.SetActive(true); gsPlay.AddCircularPlatform(Art.platform, Level.GridToPosition(new Point(322, 95)), 256, 360); CircularPlatform c2 = gsPlay.AddActivateCircularPlatform(Art.platform, Level.GridToPosition(new Point(300, 98)), 256, 360); c2.increment = -c2.increment; FlipSwitch FS5 = gsPlay.AddSwitch(new EventTrigger(this, c2), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(322, 95))); FS5.SetPlayerMode(PlayerObjectMode.Two); LightningChain lc22 = gsPlay.AddLightning(FS5.position, GridToPosition(322, 98), Color.Red); lc22.AddVertex(GridToPosition(300, 98)); lc22.AddVertex(GridToPosition(300, 98)); lc22.ConvertEndPointToTarget(c2); FS5.AddEvent(new EventTrigger(this, lc22)); Moveable m3 = gsPlay.AddMoveable(gsPlay.LoadTexture("TestSprites/moveableMechanical"), Level.GridToPosition(new Point(302, 97)), .8f); m3.SetPlayerMode(PlayerObjectMode.One); c3 = gsPlay.AddActivateCircularPlatform(Art.platform, Level.GridToPosition(new Point(342, 98)), 256, 360); c3.increment = -c3.increment; c3.SetPlayerMode(PlayerObjectMode.Two); c4 = gsPlay.AddActivateCircularPlatform(Art.platform, Level.GridToPosition(new Point(348, 98)), 256, 360); c4.angle = (float)Math.PI; c4.startAngle = c4.angle; c4.SetPlayerMode(PlayerObjectMode.One); c5 = gsPlay.AddActivateCircularPlatform(Art.platform, Level.GridToPosition(new Point(343 , 78)), 256, 360); c5.increment = -c5.increment; c5.SetPlayerMode(PlayerObjectMode.Two); c6 = gsPlay.AddActivateCircularPlatform(Art.platform, Level.GridToPosition(new Point(343, 78)), 256, 360); c5.angle = (float)Math.PI; c5.startAngle = c5.angle; c6.SetPlayerMode(PlayerObjectMode.One); Button b1 = gsPlay.AddButton(new EventTrigger(this, 5), 1, gsPlay.LoadTexture("TestSprites/button"), Level.GridToPosition(new Point(287, 99))); //287, 87 //343, 87 //Down below: 343, 98 LightningChain lc23 = gsPlay.AddLightning(b1.position, GridToPosition(287, 87), Color.Red); lc23.AddVertex(GridToPosition(343, 87)); lc23.AddVertex(GridToPosition(343, 98)); lc23.AddVertex(GridToPosition(342, 98)); lc23.AddVertex(c3.position); lc23.ConvertEndPointToTarget(c3); b1.AddEvent(new EventTrigger(this, lc23)); lc23.SetPlayerMode(PlayerObjectMode.Two); LightningChain lc24 = gsPlay.AddLightning(b1.position, GridToPosition(287, 87), Color.Red); lc24.AddVertex(GridToPosition(343, 87)); lc24.AddVertex(GridToPosition(343, 98)); lc24.AddVertex(GridToPosition(348, 98)); lc24.AddVertex(c4.position); lc24.ConvertEndPointToTarget(c4); b1.AddEvent(new EventTrigger(this, lc24)); lc24.SetPlayerMode(PlayerObjectMode.One); LightningChain lc25 = gsPlay.AddLightning(b1.position, GridToPosition(287, 87), Color.Red); lc25.AddVertex(GridToPosition(343, 87)); lc25.AddVertex(GridToPosition(343, 78)); lc25.AddVertex(c5.position); lc25.ConvertEndPointToTarget(c5); b1.AddEvent(new EventTrigger(this, lc25)); lc25.SetPlayerMode(PlayerObjectMode.Two); LightningChain lc26 = gsPlay.AddLightning(b1.position, GridToPosition(287, 87), Color.Red); lc26.AddVertex(GridToPosition(343, 87)); lc26.AddVertex(GridToPosition(343, 78)); lc26.AddVertex(c6.position); lc26.ConvertEndPointToTarget(c6); b1.AddEvent(new EventTrigger(this, lc26)); lc26.SetPlayerMode(PlayerObjectMode.One); Door p4 = gsPlay.AddOpeningDoor(Art.platform, Level.GridToPosition(new Point(80, 116)), Level.GridToPosition(new Point(80, 113)), OpenState.Closed); gsPlay.AddBouncyBall(0, gsPlay.LoadTexture("TestSprites/pickUp"), Level.GridToPosition(new Point(80, 112))); Door p5 = gsPlay.AddOpeningDoor(Art.platform, Level.GridToPosition(new Point(82, 116)), Level.GridToPosition(new Point(82, 113)), OpenState.Closed); gsPlay.AddBouncyBall(0, gsPlay.LoadTexture("TestSprites/pickUp"), Level.GridToPosition(new Point(82, 112))); p1 = gsPlay.AddReversePlatform(Art.platform, Level.GridToPosition(new Point(376, 126)), Level.GridToPosition(new Point(402, 126))); p1.SetPlayerMode(PlayerObjectMode.One); p2 = gsPlay.AddReversePlatform(Art.platform, Level.GridToPosition(new Point(376, 120)), Level.GridToPosition(new Point(402, 120))); p2.SetPlayerMode(PlayerObjectMode.Two); Button b2 = gsPlay.AddButton(new EventTrigger(this, p1), 2, gsPlay.LoadTexture("TestSprites/button"), Level.GridToPosition(new Point(81, 115))); b2.AddEvent(new EventTrigger(this, p2)); FlipSwitch FS6 = gsPlay.AddSwitch(new EventTrigger(this, p4), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(376, 118))); FS6.SetPlayerMode(PlayerObjectMode.Two); LightningChain lcpuzzle1 = gsPlay.AddLightning(FS6.position, p2.position, Color.Aqua); lcpuzzle1.AddVertex(p1.position); lcpuzzle1.ConvertEndPointToTarget(p2); FS6.AddEvent(new EventTrigger(this, lcpuzzle1)); FlipSwitch FS7 = gsPlay.AddSwitch(new EventTrigger(this, p5), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(376, 124))); FS7.SetPlayerMode(PlayerObjectMode.One); LightningChain lcpuzzle2 = gsPlay.AddLightning(FS7.position, p1.position, Color.Orange); lcpuzzle2.AddVertex(p1.position); lcpuzzle2.ConvertEndPointToTarget(p1); FS7.AddEvent(new EventTrigger(this, lcpuzzle2)); MovingPlatform p3 = gsPlay.AddReversePlatform(Art.platform, Level.GridToPosition(new Point(359, 44)), Level.GridToPosition(new Point(380, 44))); Door p6 = gsPlay.AddOpeningDoor(Art.platform, Level.GridToPosition(new Point(90, 116)), Level.GridToPosition(new Point(90, 113)), OpenState.Closed); gsPlay.AddBouncyBall(0, gsPlay.LoadTexture("TestSprites/pickUp"), Level.GridToPosition(new Point(90, 112))); Door p7 = gsPlay.AddOpeningDoor(Art.platform, Level.GridToPosition(new Point(92, 116)), Level.GridToPosition(new Point(92, 113)), OpenState.Closed); gsPlay.AddBouncyBall(0, gsPlay.LoadTexture("TestSprites/pickUp"), Level.GridToPosition(new Point(92, 112))); Button b3 = gsPlay.AddButton(new EventTrigger(this, p3), 2, gsPlay.LoadTexture("TestSprites/button"), Level.GridToPosition(new Point(91, 115))); FlipSwitch FS8 = gsPlay.AddSwitch(new EventTrigger(this, p6), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(355, 42))); FS8.SetPlayerMode(PlayerObjectMode.Two); LightningChain lcfinal1 = gsPlay.AddLightning(FS8.position, p3.position, Color.Aqua); lcfinal1.ConvertEndPointToTarget(p3); FS8.AddEvent(new EventTrigger(this, lcfinal1)); FlipSwitch FS9 = gsPlay.AddSwitch(new EventTrigger(this, p7), gsPlay.LoadTexture("TestSprites/switch"), Level.GridToPosition(new Point(355, 42))); FS9.SetPlayerMode(PlayerObjectMode.One); LightningChain lcfinal2 = gsPlay.AddLightning(FS9.position, p3.position, Color.Orange); lcfinal2.ConvertEndPointToTarget(p3); FS9.AddEvent(new EventTrigger(this, lcfinal2)); AudioManager.PlayMusic("Construction"); }
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; }