Beispiel #1
0
 public Particle AddWarmGear(Texture2D texture, Vector2 position, float scale, float rotationSpeed)
 {
     Particle gear = new Particle(texture, position);
     gear.scale = new Vector2(scale);
     gear.rotationSpeed = rotationSpeed;
     bgParticleList.Add(gear);
     gear.SetPlayerMode(PlayerObjectMode.One);
     gear.origin = new Vector2(gear.texture.Width / 2, gear.texture.Height / 2);
     gear.canDie = false;
     return gear;
 }
Beispiel #2
0
        public Particle AddRain(bool isPlayer1)
        {
            Vector2 position = Vector2.Zero;

            Player player = player1;
            if (!isPlayer1) player = player2;

            position = new Vector2(player.position.X + Mathness.RandomNumber(-Game1.screenWidth * 2, Game1.screenWidth * 2), player.position.Y - Game1.screenHeight + Mathness.RandomNumber(-100f, 100f));

            Particle p = new Particle(Art.rain, position);

            if (isPlayer1) p.SetPlayerMode(PlayerObjectMode.One);
            else p.SetPlayerMode(PlayerObjectMode.Two);

            p.speed = new Vector2(0, 12);
            p.scale = new Vector2(2);
            p.life = 240;
            particleList.Add(p);
            return p;
        }
Beispiel #3
0
 public Particle AddSignal(Player player)
 {
     Particle p = new Particle(signalTexture, player.position);
     p.startScale = .2f;
     p.endScale = 4;
     p.startAlpha = 255;
     p.endAlpha = 0;
     p.target = player;
     p.life = 60;
     p.color = player.auraColor;
     p.illuminatingAllTheTime = true;
     p.StartParticleSystems();
     particleList.Add(p);
     return p;
 }
Beispiel #4
0
        public Particle AddDreamSparkle(bool isPlayer1)
        {
            Particle p = new Particle(Art.sparkle, Vector2.Zero);
            p.speed = new Vector2(Mathness.RandomNumber(-2f, 2f), Mathness.RandomNumber(-2f, 2f));
            p.startScale = Mathness.RandomNumber(.5f, .8f);
            p.endScale = Mathness.RandomNumber(1.2f, 1.5f);
            p.rotationSpeed = Mathness.RandomNumber(.05f, .1f);
            //p.startScale = 1;
            //p.endScale = 1;
            p.fadeInOut = true;
            p.startAlpha = 0;
            p.endAlpha = 255;
            p.life = Mathness.RandomNumber(360, 480);
            p.alpha = 0;
            p.randomMinForce = new Vector2(-.1f);
            p.randomMaxForce = new Vector2(.1f);
            p.illuminatingAllTheTime = true;
            if (isPlayer1)
            {
                p.color = new Color(255, Mathness.RandomNumber(50, 150), Mathness.RandomNumber(50, 150));
                p.position = new Vector2(player1.position.X + Mathness.RandomNumber(-Game1.screenWidth, Game1.screenWidth), player1.position.Y + Mathness.RandomNumber(-Game1.screenHeight, Game1.screenHeight));
                p.SetPlayerMode(PlayerObjectMode.One);
            }
            else
            {
                p.color = new Color(Mathness.RandomNumber(50, 150), Mathness.RandomNumber(50, 150), 255);
                p.position = new Vector2(player2.position.X + Mathness.RandomNumber(-Game1.screenWidth, Game1.screenWidth), player2.position.Y + Mathness.RandomNumber(-Game1.screenHeight, Game1.screenHeight));
                p.SetPlayerMode(PlayerObjectMode.Two);
            }

            p.StartParticleSystems();

            particleList.Add(p);
            return p;
        }
Beispiel #5
0
 public Particle AddParticle(Texture2D texture, Vector2 position)
 {
     Particle p = new Particle(texture, position);
     particleList.Add(p);
     return p;
 }
Beispiel #6
0
 public Particle AddBridgeParticle(Texture2D texture, Vector2 position)
 {
     Particle p = new Particle(texture, position);
     particleList.Add(p);
     p.rotationSpeed = Mathness.RandomNumber(-.1f, .1f);
     p.randomMinForce = new Vector2(-.04f, .5f);
     p.randomMaxForce = new Vector2(.04f, .5f);
     p.canDie = false;
     return p;
 }
Beispiel #7
0
 public Particle AddBridgeSmoke()
 {
     Vector2 topLeft = new Vector2(1982, 494);
     Vector2 bottomRight = new Vector2(2317, 598);
     Particle p = new Particle(Art.smokePuff, new Vector2(Mathness.RandomNumber(topLeft.X, bottomRight.X), Mathness.RandomNumber(topLeft.Y, bottomRight.Y)));
     particleList.Add(p);
     p.startAlpha = 255;
     p.endAlpha = 0;
     p.startScale = 1.5f;
     p.endScale = 2f;
     p.rotationSpeed = Mathness.RandomNumber(-.1f, .1f);
     p.StartParticleSystems();
     return p;
 }
Beispiel #8
0
 public Particle AddAnimatedParticle(AnimatedSprite image, Vector2 position, Vector2 speed)
 {
     Particle p = new Particle(image.texture, position);
     p.SetAnimationStuff(image.minRow, image.minCol, image.rows, image.cols, image.cellW, image.cellH, image.frames, image.animationCounter);
     p.speed = speed;
     particleList.Add(p);
     return p;
 }
Beispiel #9
0
        public override void Update(GameTime gameTime)
        {
            if (isLoading) return;
            if (paused) return;

            base.Update(gameTime);

            GetInput();

            if (!GameStateManager.isMultiplayer)
            {
                switch (playerIndex)
                {
                    case PlayerIndex.One:
                        player1.stopInput = false;
                        player2.stopInput = true;

                        break;
                    case PlayerIndex.Two:
                        player1.stopInput = true;
                        player2.stopInput = false;
                        break;
                }
            }
            else
            {
                player1.stopInput = false;
                player2.stopInput = false;
            }

            PhysState player1State = player1.state;
            PhysState player2State = player2.state;

            player1.Update();
            player2.Update();

            #region Iterations

            foreach (PickUpObj pickUp in pickUpList)
            {
                pickUp.Update();
                player1.CheckForGrab(pickUp);
                player2.CheckForGrab(pickUp);
            }

            foreach (MovingPlatform platform in platformList)
            {
                player1.AdjustCollision(platform);
                player2.AdjustCollision(platform);
                foreach (PickUpObj pickUp in pickUpList)
                {
                    pickUp.AdjustCollision(platform);
                }
                foreach (Moveable move in moveList)
                {
                    move.AdjustCollision(platform);
                }
                platform.Update();
            }

            foreach (CircularPlatform platform in cPlatformList)
            {
                platform.Update();
                player1.AdjustCollision(platform);
                player2.AdjustCollision(platform);
                foreach (PickUpObj pickUp in pickUpList)
                {
                    pickUp.AdjustCollision(platform);
                }
                foreach (Moveable move in moveList)
                {
                    move.AdjustCollision(platform);
                }

            }

            foreach (Button button in buttonList)
            {
                player1.AdjustCollision(button);
                player2.AdjustCollision(button);
                foreach (PickUpObj pickUp in pickUpList)
                {
                    pickUp.AdjustCollision(button);
                }
                foreach (Moveable move in moveList)
                {
                    move.AdjustCollision(button);
                }
                button.Update();
            }

            foreach (FlipSwitch s in switchList)
            {
                s.Update();
                player1.CheckForPress(s);
                player2.CheckForPress(s);
            }

            foreach (TriggerArea area in areaList)
            {
                player1.CheckForArea(area);
                player2.CheckForArea(area);
                area.Update();
            }

            foreach (Portal portal in portalList)
            {
                portal.Update();
            }

            foreach (LightConsole console in consoleList)
            {
                console.Update();
                player1.CheckLightConsole(console);
                player2.CheckLightConsole(console);
            }

            foreach (Door door in doorList)
            {
                door.Update();
                player1.AdjustCollision(door);
                player2.AdjustCollision(door);
                foreach (PickUpObj pickUp in pickUpList) pickUp.AdjustCollision(door);
                foreach (Moveable move in moveList) move.AdjustCollision(door);
            }
            foreach (Moveable move in moveList)
            {
                move.Update();
                player1.CheckForPush(move);
                player2.CheckForPush(move);
                foreach (PickUpObj pickUp in pickUpList) pickUp.AdjustCollision(move);
                foreach (Door door in doorList) move.AdjustCollision(door);
            }
            foreach (Moveable move in moveList)
            {
                foreach (Moveable move2 in moveList) if (move != move2) move.AdjustToMoveable(move2);
            }
            //foreach (Moveable move in moveList)
            //{
            //    move.AdjustToPlayer(player1);
            //    move.AdjustToPlayer(player2);
            //}

            //if (player1State != PhysState.Grounded && player1.state == PhysState.Grounded) AudioManager.playerLand.Play();
            //if (player2State != PhysState.Grounded && player2.state == PhysState.Grounded) AudioManager.playerLand.Play();

            foreach (PortalParticles pp in ppList)
            {
                pp.Update();
            }

            foreach (ParticleEmitter emitter in emitterList)
            {
                if (emitter.IsOnScreen(cameraPlayer1) || emitter.IsOnScreen(cameraPlayer2))
                {
                    emitter.Update();
                }
            }
            foreach (TimerObject timer in timerList)
            {
                timer.Update();
            }

            Particle[] tempParticles = new Particle[particleList.Count];
            particleList.CopyTo(tempParticles);
            foreach (Particle particle in tempParticles)
            {
                //if (particle.IsOnScreen(cameraPlayer1) || particle.IsOnScreen(cameraPlayer2))
                //{
                    particle.Update();
                    if (particle.isDead) particleList.Remove(particle);
                //}
            }

            tempParticles = new Particle[bgParticleList.Count];
            bgParticleList.CopyTo(tempParticles);
            foreach (Particle particle in tempParticles)
            {
                //if (particle.IsOnScreen(cameraPlayer1) || particle.IsOnScreen(cameraPlayer2))
                //{
                    particle.Update();
                    if (particle.isDead) bgParticleList.Remove(particle);
                //}
            }

            foreach (PointLight light in lightList)
            {
                light.Update();
            }

            foreach (ParallaxLayer layer in bgLayerList)
            {
                foreach (SpriteIMG bg in layer.imageList)
                {
                    bg.Update();
                }
            }
            foreach (LightningChain lightning in lightningList)
            {
                lightning.Update();
            }
            foreach (SpriteIMG img in frontFGList) img.Update();

            #endregion

            dreamParticleCounter += Time.GetSeconds();

            if (dreamParticleCounter >= dreamParticleRate)
            {
                AddDreamSparkle(true);
                AddDreamSparkle(false);
                dreamParticleCounter = 0;
            }

            cameraPlayer1.Update();
            cameraPlayer2.Update();
        }
Beispiel #10
0
 public static void AddObjectDeath(Vector2 position)
 {
     for (int i = 0; i < 8; i++)
     {
         Particle p = new Particle(Art.smokePuff, position);
         p.life = 30;
         p.speed = new Vector2(Mathness.RandomNumber(-1.5f, 1.5f), Mathness.RandomNumber(-1.5f, 1.5f));
         p.startAlpha = 255;
         p.endAlpha = 0;
         p.startScale = Mathness.RandomNumber(.8f, 1.2f);
         p.endScale = Mathness.RandomNumber(1.8f, 2.2f);
         p.StartParticleSystems();
         particleList.Add(p);
     }
 }
Beispiel #11
0
        public static void AddCheckpointParticles(Vector2 position, bool isPlayer1)
        {
            for (int i = 0; i < 10; i++)
            {
                Particle p = new Particle(Art.sparkle, position);
                p.position += new Vector2(Mathness.RandomNumber(-10f, 10f), Mathness.RandomNumber(-10f, 10f));
                p.speed = new Vector2(Mathness.RandomNumber(-2f, 2f), Mathness.RandomNumber(-2f, 2f));
                p.randomMinForce = new Vector2(0, 0);
                p.randomMaxForce = new Vector2(0, .08f);
                p.startAlpha = 255;
                p.endAlpha = 0;
                p.startScale = .5f;
                p.endScale = .75f;
                p.life = 80;
                if (isPlayer1) p.color = Color.Red;
                else p.color = Color.Blue;
                p.illuminatingAllTheTime = true;

                p.StartParticleSystems();

                particleList.Add(p);
            }
        }
Beispiel #12
0
        public void SetupLevel()
        {
            Color[] color1D = new Color[levelDataTexture.Width * levelDataTexture.Height];
            levelDataTexture.GetData(color1D);
            Color[,] colorData = new Color[levelDataTexture.Width, levelDataTexture.Height];
            for (int x = 0; x < levelDataTexture.Width; x++)
                for (int y = 0; y < levelDataTexture.Height; y++)
                    colorData[x, y] = color1D[x + y * levelDataTexture.Width];

            levelWidth = levelDataTexture.Width * collisionSize;
            levelHeight = levelDataTexture.Height * collisionSize;
            deathHeight = levelHeight;
            levelGridSize = new Point(levelDataTexture.Width, levelDataTexture.Height);
            environmentData = new EnvironmentData[levelDataTexture.Width, levelDataTexture.Height];
            for (int x = 0; x < levelDataTexture.Width; x++)
            {
                for (int y = 0; y < levelDataTexture.Height; y++)
                {
                    if (colorData[x, y] == Color.Black)
                    {
                        environmentData[x, y] = new EnvironmentData(true);
                        if (renderCollision)
                        {
                            SpriteIMG tile = new SpriteIMG(gsPlay.LoadTexture("TestSprites/tile"), GridToPosition(new Point(x, y)));
                            tile.origin = Vector2.Zero;
                            gsPlay.backFGList.Add(tile);
                            gsPlay.AddGroundTile(GridToPosition(new Point(x, y)) + new Vector2(16, 16));
                        }
                    }
                    else if (colorData[x, y] == new Color(0, 0, 255))
                    {
                        environmentData[x, y] = new EnvironmentData(FrictionType.Ice);
                        SpriteIMG tile = new SpriteIMG(gsPlay.LoadTexture("TestSprites/tile"), GridToPosition(new Point(x, y)));
                        tile.origin = Vector2.Zero;
                        tile.color = new Color(0, 0, 255);
                        gsPlay.backFGList.Add(tile);
                    }
                    else if (colorData[x, y] == new Color(0, 255, 0))
                    {
                        environmentData[x, y] = new EnvironmentData(new Vector2(0, -1f));
                        gsPlay.AddWindEmitter(GridToPosition(x, y) + new Vector2(8, 32), new Vector2(0, -2));
                        //SpriteIMG tile = new SpriteIMG(gsPlay.LoadTexture("TestSprites/airCurrentUp"), GridToPosition(new Point(x, y)));
                        //tile.origin = Vector2.Zero;
                        //tile.alpha = 128;
                        //gsPlay.backFGList.Add(tile);
                    }
                    else if (colorData[x, y] == new Color(255, 0, 0))
                    {
                        environmentData[x, y] = new EnvironmentData(new Vector2(0, 1f));
                        gsPlay.AddWindEmitter(GridToPosition(x, y) + new Vector2(16, -16), new Vector2(0, 2));
                        //SpriteIMG tile = new SpriteIMG(gsPlay.LoadTexture("TestSprites/airCurrentDown"), GridToPosition(new Point(x, y)));
                        //tile.origin = Vector2.Zero;
                        //tile.scale = new Vector2(2);
                        //tile.alpha = 128;
                        //gsPlay.backFGList.Add(tile);
                    }
                    else if (colorData[x, y] == new Color(255, 255, 0))
                    {
                        environmentData[x, y] = new EnvironmentData(new Vector2(4, 0));
                        gsPlay.AddWindEmitter(GridToPosition(x, y) + new Vector2(-16, 16), new Vector2(2, 0));
                        //SpriteIMG tile = new SpriteIMG(gsPlay.LoadTexture("TestSprites/airCurrentRight"), GridToPosition(new Point(x, y)));
                        //tile.origin = Vector2.Zero;
                        //tile.alpha = 128;
                        //tile.scale = new Vector2(2);
                        //gsPlay.frontFGList.Add(tile);
                    }
                    else if (colorData[x, y] == new Color(0, 255, 255))
                    {
                        environmentData[x, y] = new EnvironmentData(new Vector2(-4, 0));
                        gsPlay.AddWindEmitter(GridToPosition(x, y) + new Vector2(48, 16), new Vector2(-2, 0));
                        //SpriteIMG tile = new SpriteIMG(gsPlay.LoadTexture("TestSprites/airCurrentLeft"), GridToPosition(new Point(x, y)));
                        //tile.origin = Vector2.Zero;
                        //tile.alpha = 128;
                        //tile.scale = new Vector2(2);
                        //gsPlay.frontFGList.Add(tile);
                    }
                    else if (colorData[x, y] == new Color(255, 255, 150))
                    {
                        environmentData[x, y] = new EnvironmentData(InclineType.ThreeTileRight1, FrictionType.Normal);
                        if (renderCollision)
                        {
                            SpriteIMG tile = new SpriteIMG(gsPlay.LoadTexture("TestSprites/tileInclineThreeRight1"), GridToPosition(new Point(x, y)));
                            tile.origin = Vector2.Zero;
                            gsPlay.backFGList.Add(tile);
                        }
                    }
                    else if (colorData[x, y] == new Color(255, 255, 100))
                    {
                        environmentData[x, y] = new EnvironmentData(InclineType.ThreeTileRight2, FrictionType.Normal);
                        if (renderCollision)
                        {
                            SpriteIMG tile = new SpriteIMG(gsPlay.LoadTexture("TestSprites/tileInclineThreeRight2"), GridToPosition(new Point(x, y)));
                            tile.origin = Vector2.Zero;
                            gsPlay.backFGList.Add(tile);
                        }
                    }
                    else if (colorData[x, y] == new Color(255, 255, 50))
                    {
                        environmentData[x, y] = new EnvironmentData(InclineType.ThreeTileRight3, FrictionType.Normal);
                        if (renderCollision)
                        {
                            SpriteIMG tile = new SpriteIMG(gsPlay.LoadTexture("TestSprites/tileInclineThreeRight3"), GridToPosition(new Point(x, y)));
                            tile.origin = Vector2.Zero;
                            gsPlay.backFGList.Add(tile);
                        }
                    }
                    else if (colorData[x, y] == new Color(50, 255, 255))
                    {
                        environmentData[x, y] = new EnvironmentData(InclineType.ThreeTileLeft1, FrictionType.Normal);
                        if (renderCollision)
                        {
                            SpriteIMG tile = new SpriteIMG(gsPlay.LoadTexture("TestSprites/tileInclineThreeLeft1"), GridToPosition(new Point(x, y)));
                            tile.origin = Vector2.Zero;
                            gsPlay.backFGList.Add(tile);
                        }
                    }
                    else if (colorData[x, y] == new Color(100, 255, 255))
                    {
                        environmentData[x, y] = new EnvironmentData(InclineType.ThreeTileLeft2, FrictionType.Normal);
                        if (renderCollision)
                        {
                            SpriteIMG tile = new SpriteIMG(gsPlay.LoadTexture("TestSprites/tileInclineThreeLeft2"), GridToPosition(new Point(x, y)));
                            tile.origin = Vector2.Zero;
                            gsPlay.backFGList.Add(tile);
                        }
                    }
                    else if (colorData[x, y] == new Color(150, 255, 255))
                    {
                        environmentData[x, y] = new EnvironmentData(InclineType.ThreeTileLeft3, FrictionType.Normal);
                        if (renderCollision)
                        {
                            SpriteIMG tile = new SpriteIMG(gsPlay.LoadTexture("TestSprites/tileInclineThreeLeft3"), GridToPosition(new Point(x, y)));
                            tile.origin = Vector2.Zero;
                            gsPlay.backFGList.Add(tile);
                        }
                    }
                    else if (colorData[x, y] == new Color(64, 255, 255))
                    {
                        environmentData[x, y] = new EnvironmentData(InclineType.TwoTileLeft1, FrictionType.Normal);
                        if (renderCollision)
                        {
                            SpriteIMG tile = new SpriteIMG(gsPlay.LoadTexture("TestSprites/tileInclineTwoLeft1"), GridToPosition(new Point(x, y)));
                            tile.origin = Vector2.Zero;
                            gsPlay.backFGList.Add(tile);
                        }
                    }
                    else if (colorData[x, y] == new Color(128, 255, 255))
                    {
                        environmentData[x, y] = new EnvironmentData(InclineType.TwoTileLeft2, FrictionType.Normal);
                        if (renderCollision)
                        {
                            SpriteIMG tile = new SpriteIMG(gsPlay.LoadTexture("TestSprites/tileInclineTwoLeft2"), GridToPosition(new Point(x, y)));
                            tile.origin = Vector2.Zero;
                            gsPlay.backFGList.Add(tile);
                        }
                    }
                    else if (colorData[x, y] == new Color(255, 255, 128))
                    {
                        environmentData[x, y] = new EnvironmentData(InclineType.TwoTileRight1, FrictionType.Normal);
                        if (renderCollision)
                        {
                            SpriteIMG tile = new SpriteIMG(gsPlay.LoadTexture("TestSprites/tileInclineTwoRight1"), GridToPosition(new Point(x, y)));
                            tile.origin = Vector2.Zero;
                            gsPlay.backFGList.Add(tile);
                        }
                    }
                    else if (colorData[x, y] == new Color(255, 255, 64))
                    {
                        environmentData[x, y] = new EnvironmentData(InclineType.TwoTileRight2, FrictionType.Normal);
                        if (renderCollision)
                        {
                            SpriteIMG tile = new SpriteIMG(gsPlay.LoadTexture("TestSprites/tileInclineTwoRight2"), GridToPosition(new Point(x, y)));
                            tile.origin = Vector2.Zero;
                            gsPlay.backFGList.Add(tile);
                        }
                    }
                    else if (colorData[x, y] == new Color(50, 50, 50))
                    {
                        environmentData[x, y] = new EnvironmentData(true);
                        environmentData[x, y].oneWayPlatform = true;
                        if (renderCollision)
                        {
                            SpriteIMG tile = new SpriteIMG(gsPlay.LoadTexture("TestSprites/jumpThru"), GridToPosition(new Point(x, y)));
                            tile.origin = Vector2.Zero;
                            gsPlay.backFGList.Add(tile);
                        }
                    }
                    else if (colorData[x, y] == new Color(255, 128, 255))
                    {
                        environmentData[x, y] = new EnvironmentData(false);
                        environmentData[x, y].checkpoint = true;
                        SpriteIMG tile = new SpriteIMG(gsPlay.LoadTexture("TestSprites/checkpoint"), GridToCenterPosition(new Point(x, y)));
                        tile.scale = new Vector2(1.5f);
                        gsPlay.backFGList.Add(tile);
                    }
                    else if (colorData[x, y] == new Color(255, 128, 0))
                    {
                        environmentData[x, y] = new EnvironmentData(false);
                        environmentData[x, y].killZone = true;
                        //SpriteIMG tile = new SpriteIMG(gsPlay.LoadTexture("TestSprites/killZone"), GridToPosition(new Point(x, y)));
                        //tile.origin = Vector2.Zero;
                        //gsPlay.backFGList.Add(tile);
                        //gsPlay.AddFireParticle(GridToCenterPosition(x, y));
                    }
                    else if (colorData[x, y] == new Color(255, 128, 1))
                    {
                        environmentData[x, y] = new EnvironmentData(false);
                        environmentData[x, y].killZone = true;
                        gsPlay.AddFireParticle(GridToCenterPosition(x, y));
                    }
                    else if (colorData[x, y] == new Color(255, 128, 2))
                    {
                        environmentData[x, y] = new EnvironmentData(false);
                        environmentData[x, y].killZone = true;
                        gsPlay.AddSpinningFireParticle(GridToCenterPosition(x, y));
                    }
                    else
                    {
                        environmentData[x, y] = new EnvironmentData(false);
                    }
                }
            }

            gsPlay.player1 = new Player(gsPlay, PlayerObjectMode.One, gsPlay.LoadTexture("player1"), player1Pos);
            gsPlay.player1.SetAnimationStuff(1, 1, 8, 8, 256, 256, 64, 5);
            gsPlay.player1.SetCollisionBox(48, 96, Vector2.Zero);
            gsPlay.player2 = new Player(gsPlay, PlayerObjectMode.Two, gsPlay.LoadTexture("player2"), player2Pos);
            gsPlay.player2.SetAnimationStuff(1, 1, 8, 8, 256, 256, 64, 5);
            gsPlay.player2.SetCollisionBox(48, 96, Vector2.Zero);

            player1Checkpoint = gsPlay.AddBGParticle(gsPlay.LoadTexture("TestSprites/checkpointWarm"), new Vector2(-64, -64));
            player1Checkpoint.SetPlayerMode(PlayerObjectMode.One);
            player1Checkpoint.scale = new Vector2(1.5f);
            player1Checkpoint.canDie = false;
            player1Checkpoint.illuminatingAllTheTime = true;
            player2Checkpoint = gsPlay.AddBGParticle(gsPlay.LoadTexture("TestSprites/checkpointCool"), new Vector2(-64, -64));
            player2Checkpoint.SetPlayerMode(PlayerObjectMode.Two);
            player2Checkpoint.scale = new Vector2(1.5f);
            player2Checkpoint.canDie = false;
            player2Checkpoint.illuminatingAllTheTime = true;

            if (hasPortal)
            {
                glados = gsPlay.AddPortal(new EventTrigger(this, 0), gsPlay.LoadTexture("TestSprites/portal"), portalPos);
                glados.SetAnimationStuff(2, 1, 2, 8, 96, 192, 8, 5);
                PortalItem goody = new PortalItem(new EventTrigger(this, glados), gsPlay.LoadTexture("TestSprites/Cursor"), pItemPos);
                gsPlay.areaList.Add(goody);
                goody.SetCollisionBox(32, 32, Vector2.Zero);
                goody.visible = false;
                GlyphEmitter ge = new GlyphEmitter(gsPlay, Art.portalItem1, pItemPos);
                ge.AddTexture(Art.portalItem2);
                ge.AddTexture(Art.portalItem3);
                ge.AddTexture(Art.portalItem4);
                ge.AddTexture(Art.portalItem5);
                ge.selfIlluminated = true;
                ge.startAlpha = 0;
                ge.endAlpha = 255;
                ge.fadeInOut = true;
                ge.startScale = .75f;
                ge.endScale = 1.25f;
                ge.spawnRate = 10;
                ge.life = 40;
                //ge.randomDisplacement = new Vector2(8, 8);
                ge.randomSpeedX = new Vector2(-.75f, .75f);
                ge.randomSpeedY = new Vector2(-.75f, .75f);
                gsPlay.emitterList.Add(ge);
                goody.emitter = ge;

                AnimatedSprite pulseSprite = new AnimatedSprite(Art.portalPulse);
                ParticleEmitter pulse = gsPlay.AddEmitter(pulseSprite, glados.position);
                pulse.bgParticles = true;
                pulse.color = new Color(128, 0, 0);
                pulse.startScale = 1;
                pulse.endScale = 2;
                pulse.startAlpha = 255;
                pulse.endAlpha = 0;
                pulse.randomRotation = false;
                pulse.rotationSpeed = 0;
                pulse.spawnRate = 30;
                pulse.life = 60;
                glados.pulse = pulse;

                LightningChain portalLightning = gsPlay.AddLightning(glados.position + new Vector2(0, -48), glados.position + new Vector2(20, -27), Color.Red);
                portalLightning.AddVertex(glados.position + new Vector2(20, 27));
                portalLightning.AddVertex(glados.position + new Vector2(0, 48));
                portalLightning.AddVertex(glados.position + new Vector2(-20, 27));
                portalLightning.AddVertex(glados.position + new Vector2(-20, -27));
                portalLightning.AddVertex(glados.position + new Vector2(0, -48));
                portalLightning.SetActive(true);
                portalLightning.defaultActive = true;
                goody.AddEvent(new EventTrigger(this, portalLightning));
                //40x55

                List<Particle> particleList = new List<Particle>();
                for (int i = 1; i <= 6; i++)
                {
                    Particle p = gsPlay.AddParticle(Art.sparkle, Vector2.Zero);
                    p.canDie = false;
                    if (i % 2 == 0) p.color = new Color(246, 133, 23);
                    else p.color = new Color(145, 127, 185);
                    p.alpha = 128;
                    particleList.Add(p);
                }
                PortalParticles pp = new PortalParticles(gsPlay, particleList);
                pp.AddVertex(glados.position + new Vector2(0, -53));
                pp.AddVertex(glados.position + new Vector2(25, -27));
                pp.AddVertex(glados.position + new Vector2(25, 27));
                pp.AddVertex(glados.position + new Vector2(0, 53));
                pp.AddVertex(glados.position + new Vector2(-25, 27));
                pp.AddVertex(glados.position + new Vector2(-25, -27));
                pp.SetUpParticles();
                pp.Deactivate();
                gsPlay.ppList.Add(pp);
                goody.AddEvent(new EventTrigger(this, pp));

            }

            gsPlay.cameraPlayer1 = new Camera(gsPlay.player1, gsPlay.player2, Vector2.Zero);
            gsPlay.cameraPlayer2 = new Camera(gsPlay.player2, gsPlay.player1, Vector2.Zero);

            if (glados != null)
            {
                gsPlay.cameraPlayer1.AddTarget(glados);
                gsPlay.cameraPlayer2.AddTarget(glados);
            }
        }