/// <summary> /// Load graphics content for the game. /// </summary> public override void Activate(bool instancePreserved) { if (!instancePreserved) { if (content == null) { content = new ContentManager(ScreenManager.Game.Services, "Content"); } gameFont = content.Load <SpriteFont>("gamefont"); bloom = new BloomComponent(ScreenManager.Game); ScreenManager.Game.Components.Add(bloom); area = new Area(content.Load <Texture2D>("pinkArea"), new Vector2(500, 500), 0f, world); cam2D = new Cam2d(ScreenManager.GraphicsDevice); reticle = content.Load <Texture2D>("redReticle"); /// player playerBody = new PlayerBody(content.Load <Texture2D>("redPlayer"), world, content); Pickupables.Add(new Pickupable(content.Load <Texture2D>("Squares/pinkSquare"), new Vector2(100, 100), world)); Pickupables.Add(new Pickupable(content.Load <Texture2D>("Squares/pinkSquare"), new Vector2(100, 80), world)); Pickupables.Add(new Pickupable(content.Load <Texture2D>("Squares/pinkSquare"), new Vector2(120, 100), world)); int space = 0; for (int i = 0; i < 11; i++) { Walls.Add(new Wall(content.Load <Texture2D>("Walls/blueWallMedium"), new Vector2(space - 5, 0), true, world)); Walls.Add(new Wall(content.Load <Texture2D>("Walls/blueWallMedium"), new Vector2(space - 5, 600), true, world)); if (i <= 5) { //vertical walls Walls.Add(new Wall(content.Load <Texture2D>("Walls/blueWallMedium"), new Vector2(-50, space + 50), false, world)); Walls.Add(new Wall(content.Load <Texture2D>("Walls/blueWallMedium"), new Vector2(1050, space + 50), false, world)); } space += 100; } Walls.Add(new Wall(content.Load <Texture2D>("Walls/blueWallMedium"), new Vector2(1050, 45), false, world)); Walls.Add(new Wall(content.Load <Texture2D>("Walls/blueWallMedium"), new Vector2(1050, 555), false, world)); // set cam track cam2D.TrackingBody = playerBody.playerBody; cam2D.EnableTracking = true; // once the load has finished, we use ResetElapsedTime to tell the game's // timing mechanism that we have just finished a very long frame, and that // it should not try to catch up. ScreenManager.Game.ResetElapsedTime(); } base.Activate(instancePreserved); }
/// <summary> /// Load graphics content for the game. /// </summary> public override void Activate(bool instancePreserved) { if (!instancePreserved) { if (content == null) content = new ContentManager(ScreenManager.Game.Services, "Content"); gameFont = content.Load<SpriteFont>("gamefont"); bloom = new BloomComponent(ScreenManager.Game); ScreenManager.Game.Components.Add(bloom); area = new Area(content.Load<Texture2D>("pinkArea"),new Vector2(500,500),0f,world); cam2D = new Cam2d(ScreenManager.GraphicsDevice); reticle = content.Load<Texture2D>("redReticle"); /// player playerBody = new PlayerBody(content.Load<Texture2D>("redPlayer"), world, content); Pickupables.Add(new Pickupable(content.Load<Texture2D>("Squares/pinkSquare"), new Vector2(100, 100), world)); Pickupables.Add(new Pickupable(content.Load<Texture2D>("Squares/pinkSquare"), new Vector2(100, 80), world)); Pickupables.Add(new Pickupable(content.Load<Texture2D>("Squares/pinkSquare"), new Vector2(120, 100), world)); int space = 0; for (int i = 0; i < 11; i++) { Walls.Add(new Wall(content.Load<Texture2D>("Walls/blueWallMedium"), new Vector2(space - 5, 0), true, world)); Walls.Add(new Wall(content.Load<Texture2D>("Walls/blueWallMedium"), new Vector2(space - 5, 600), true, world)); if (i <= 5) { //vertical walls Walls.Add(new Wall(content.Load<Texture2D>("Walls/blueWallMedium"), new Vector2(-50, space + 50), false, world)); Walls.Add(new Wall(content.Load<Texture2D>("Walls/blueWallMedium"), new Vector2(1050, space + 50), false, world)); } space += 100; } Walls.Add(new Wall(content.Load<Texture2D>("Walls/blueWallMedium"), new Vector2(1050, 45), false, world)); Walls.Add(new Wall(content.Load<Texture2D>("Walls/blueWallMedium"), new Vector2(1050, 555), false, world)); // set cam track cam2D.TrackingBody = playerBody.playerBody; cam2D.EnableTracking = true; // once the load has finished, we use ResetElapsedTime to tell the game's // timing mechanism that we have just finished a very long frame, and that // it should not try to catch up. ScreenManager.Game.ResetElapsedTime(); } base.Activate(instancePreserved); }
/// <summary> /// Load graphics content for the game. /// </summary> public override void Activate(bool instancePreserved) { if (!instancePreserved) { if (content == null) content = new ContentManager(ScreenManager.Game.Services, "Content"); gameFont = content.Load<SpriteFont>("gamefont"); bloom = new BloomComponent(ScreenManager.Game); ScreenManager.Game.Components.Add(bloom); cam2D = new Cam2d(ScreenManager.GraphicsDevice); reticle = content.Load<Texture2D>("redReticle"); /// player playerBody = new PlayerBody(content.Load<Texture2D>("redPlayer"), world, content); // drones - can only have two without performance issues { Drones.Add(new SeekerDrone(content.Load<Texture2D>("testArrow"), new Vector2(100, 500), world, content, 10)); Drones.Add(new SeekerDrone(content.Load<Texture2D>("testArrow"), new Vector2(200, 150), world, content, 9)); Drones.Add(new SeekerDrone(content.Load<Texture2D>("testArrow"), new Vector2(300, 200), world, content, 12)); Drones.Add(new SeekerDrone(content.Load<Texture2D>("testArrow"), new Vector2(400, 250), world, content, 14)); Drones.Add(new SeekerDrone(content.Load<Texture2D>("testArrow"), new Vector2(500, 300), world, content, 20)); Drones.Add(new SeekerDrone(content.Load<Texture2D>("testArrow"), new Vector2(600, 350), world, content, 25)); Drones[0].Stationary = true; Drones[5].Stationary = true; } { Squares.Add(new Square(content.Load<Texture2D>("Squares/greenSquare"), new Vector2(0, 50), world)); Squares.Add(new Square(content.Load<Texture2D>("Squares/greenSquare"), new Vector2(400, 50), world)); Squares.Add(new Square(content.Load<Texture2D>("Squares/greenSquare"), new Vector2(240, 350), world)); Squares.Add(new Square(content.Load<Texture2D>("Squares/greenSquare"), new Vector2(300, 400), world)); Squares.Add(new Square(content.Load<Texture2D>("Squares/greenSquare"), new Vector2(300, 550), world)); } int space = 0; int i = 0; for (; i < 11; i++) { Walls.Add(new Wall(content.Load<Texture2D>("Walls/blueWallMedium"), new Vector2(space - 5, 0), true, world)); Walls.Add(new Wall(content.Load<Texture2D>("Walls/blueWallMedium"), new Vector2(space - 5, 600), true, world)); if (i <= 5) { //vertical walls Walls.Add(new Wall(content.Load<Texture2D>("Walls/blueWallMedium"), new Vector2(-50, space + 50), false, world)); Walls.Add(new Wall(content.Load<Texture2D>("Walls/blueWallMedium"), new Vector2(1050, space + 50), false, world)); } space += 100; } Walls.Add(new Wall(content.Load<Texture2D>("Walls/blueWallMedium"), new Vector2(1050, 45 ), false, world)); Walls.Add(new Wall(content.Load<Texture2D>("Walls/blueWallMedium"), new Vector2(1050, 555), false, world)); // set cam track cam2D.TrackingBody = playerBody.playerBody; cam2D.EnableTracking = true; // once the load has finished, we use ResetElapsedTime to tell the game's // timing mechanism that we have just finished a very long frame, and that // it should not try to catch up. ScreenManager.Game.ResetElapsedTime(); } base.Activate(instancePreserved); }
/// <summary> /// Load graphics content for the game. /// </summary> public override void Activate(bool instancePreserved) { if (!instancePreserved) { if (content == null) content = new ContentManager(ScreenManager.Game.Services, "Content"); gameFont = content.Load<SpriteFont>("gamefont"); Song = content.Load<Song>("Audio/Soundtrack/Mr_Spastic_-_b3ta_B1t3r"); if (MediaPlayer.State != MediaState.Paused) { MediaPlayer.Volume = 0.75f; MediaPlayer.Play(Song); MediaPlayer.IsRepeating = true; } else { MediaPlayer.Resume(); } bloom = new BloomComponent(ScreenManager.Game); for (int k = 0; k < ScreenManager.Game.Components.Count; ++k) { if(ScreenManager.Game.Components[k].Equals(bloom)) { ScreenManager.Game.Components.RemoveAt(k); } } // ScreenManager.Game.Components.Add(bloom); playerBody = new PlayerBody(content.Load<Texture2D>("redPlayer"), world,content); cam2D = new Cam2d(ScreenManager.GraphicsDevice); reticle = content.Load<Texture2D>("redReticle"); // neon whip wheel { // instantiate the cirlce body circleBody = BodyFactory.CreateCircle(world, 20.0f / 64, 1f, new Vector2(1000f / 64f, 1000f / 64f)); circleBody.BodyType = BodyType.Static; circleBody.CollisionCategories = Category.Cat2; circleBody.BodyId = 11; circleTex = content.Load<Texture2D>("orangeCircle"); // fix the circle to the world FixedRevoluteJoint fixedJoint = new FixedRevoluteJoint(circleBody, Vector2.Zero, circleBody.Position); world.AddJoint(fixedJoint); // create the whips Whips.Add(new Whip(content.Load<Texture2D>("orangeChianLinkSmall"), new Vector2(1000, 1000), new Vector2(1350, 1000f), world)); Whips.Add(new Whip(content.Load<Texture2D>("orangeChianLinkSmall"), new Vector2(1000, 1000), new Vector2(650, 1000), world)); // Whips.Add(new Whip(content.Load<Texture2D>("orangeChianLinkSmall"), new Vector2(1000, 1000), new Vector2(1000, 1350), world)); for (int k = 0; k < Whips.Count; k++) { world.AddJoint(new FixedRevoluteJoint(Whips[k].chainLinks[k], Vector2.Zero, circleBody.Position)); } } // add badies { Badies.Add(new Bady(content.Load<Texture2D>("Badies/orangeBady"), new Vector2(-1, -2), 15, true, 180f, content, world)); Badies.Add(new Bady(content.Load<Texture2D>("Badies/pinkBady"), new Vector2(-3, 0.5f), 8, false, 90f, content, world)); } // add some squares and some walls { int space = 0; for (int i = 0; i < 10; i++) { Walls.Add(new Wall(content.Load<Texture2D>("Walls/blueWallMedium"), new Vector2(space - 5, 0), true, world)); Walls.Add(new Wall(content.Load<Texture2D>("Walls/blueWallMedium"), new Vector2(space - 5, 600), true, world)); Squares.Add(new Square(content.Load<Texture2D>("Squares/greenSquare"), new Vector2(space, 100), world)); Squares.Add(new Square(content.Load<Texture2D>("Squares/greenSquare"), new Vector2(space + 50, 200), world)); Squares.Add(new Square(content.Load<Texture2D>("Squares/greenSquare"), new Vector2(space, 300), world)); Squares.Add(new Square(content.Load<Texture2D>("Squares/greenSquare"), new Vector2(space + 50, 400), world)); Squares.Add(new Square(content.Load<Texture2D>("Squares/greenSquare"), new Vector2(space, 500), world)); if (i <= 5) { //vertical walls Walls.Add(new Wall(content.Load<Texture2D>("Walls/blueWallMedium"), new Vector2(-50, space + 50), false, world)); Walls.Add(new Wall(content.Load<Texture2D>("Walls/blueWallMedium"), new Vector2(1050, space + 50), false, world)); } space += 100; } Squares.Add(new Square(content.Load<Texture2D>("Squares/greenSquare"), new Vector2(space , 100), world)); Squares.Add(new Square(content.Load<Texture2D>("Squares/greenSquare"), new Vector2(space, 300), world)); Squares.Add(new Square(content.Load<Texture2D>("Squares/greenSquare"), new Vector2(space , 500), world)); // extra wall Walls.Add(new Wall(content.Load<Texture2D>("Walls/blueWallMedium"), new Vector2(space + 5, 0), true, world)); Walls.Add(new Wall(content.Load<Texture2D>("Walls/blueWallMedium"), new Vector2(space - 10, 0), true, world)); // Ninja gate { ninjaGate = new Shape(content.Load<Texture2D>("NinjaWeapons/blueNinjaWheel"),new Vector2((space - 5), 600f),false,false,world); Shapes.Add(ninjaGate); Shapes[0].shapeBody.AngularVelocity = 10f; // Shapes.Add(new Shape(content.Load<Texture2D>("NinjaWeapons/blueNinjaWheel"),new Vector2((space - 5), 600f),false,world)); world.AddJoint(new FixedRevoluteJoint(Shapes[0].shapeBody, Vector2.Zero, Shapes[0].shapeBody.Position)); } } //add collectables { Collectables.Add(new Collectable(content.Load<Texture2D>("redStar"), new Vector2(0, 25), world)); Collectables.Add(new Collectable(content.Load<Texture2D>("redStar"), new Vector2(900, 25), world)); Collectables.Add(new Collectable(content.Load<Texture2D>("redStar"), new Vector2(900, 625), world)); } // set cam track cam2D.TrackingBody = playerBody.playerBody; cam2D.EnableTracking = true; // once the load has finished, we use ResetElapsedTime to tell the game's // timing mechanism that we have just finished a very long frame, and that // it should not try to catch up. ScreenManager.Game.ResetElapsedTime(); } }
/// <summary> /// Load graphics content for the game. /// </summary> public override void Activate(bool instancePreserved) { if (!instancePreserved) { if (content == null) content = new ContentManager(ScreenManager.Game.Services, "Content"); gameFont = content.Load<SpriteFont>("gamefont"); bloom = new BloomComponent(ScreenManager.Game); ScreenManager.Game.Components.Add(bloom); cam2D = new Cam2d(ScreenManager.GraphicsDevice); reticle = content.Load<Texture2D>("redReticle"); /// player playerBody = new PlayerBody(content.Load<Texture2D>("redPlayer"), world, content); playerBody.setPostion = new Vector2(900, 100); Squares.Add(new Square(content.Load<Texture2D>("Squares/greenSquare"), new Vector2(-28, 200 ), world)); //spinning wheel. { Walls.Add(new Wall(content.Load<Texture2D>("Walls/blueWallMedium"), new Vector2(-5, 250), false, world)); Walls.Add(new Wall(content.Load<Texture2D>("Walls/blueWallMedium"), new Vector2(-5, 350), false, world)); // filler Walls.Add(new Wall(content.Load<Texture2D>("Walls/blueWallMedium"), new Vector2(205, 360), false, world)); Walls.Add(new Wall(content.Load<Texture2D>("Walls/blueWallMedium"), new Vector2(205, 250), false, world)); // filler Walls.Add(new Wall(content.Load<Texture2D>("Walls/blueWallMedium"), new Vector2(205, 240), false, world)); Walls.Add(new Wall(content.Load<Texture2D>("Walls/blueWallMedium"), new Vector2(205, 350), false, world)); Walls.Add(new Wall(content.Load<Texture2D>("Walls/blueWallMedium"), new Vector2(160, 190), true, world)); Walls.Add(new Wall(content.Load<Texture2D>("Walls/blueWallMedium"), new Vector2(160, 410), true, world)); spinningWheel = new Shape(content.Load<Texture2D>("Shapes/orangeSpinningWheel"), new Vector2(100, 300), true,false, world); FixedRevoluteJoint fixedJoint = new FixedRevoluteJoint(spinningWheel.shapeBody, Vector2.Zero, spinningWheel.shapeBody.Position); world.AddJoint(fixedJoint); } int space = 0; int k = 260; for (; k < 1000; k += 100) { Walls.Add(new Wall(content.Load<Texture2D>("Walls/blueWallMedium"), new Vector2(k, 190), true, world)); } Walls.Add(new Wall(content.Load<Texture2D>("Walls/blueWallMedium"), new Vector2(k - 65, 190), true, world)); for (int i = 0; i < 11; i++) { Walls.Add(new Wall(content.Load<Texture2D>("Walls/blueWallMedium"), new Vector2(space - 5, 0), true, world)); Walls.Add(new Wall(content.Load<Texture2D>("Walls/blueWallMedium"), new Vector2(space - 5, 600), true, world)); if (i <= 5) { //vertical walls Walls.Add(new Wall(content.Load<Texture2D>("Walls/blueWallMedium"), new Vector2(-50, space + 50), false, world)); Walls.Add(new Wall(content.Load<Texture2D>("Walls/blueWallMedium"), new Vector2(1050, space + 50), false, world)); } space += 100; } Walls.Add(new Wall(content.Load<Texture2D>("Walls/blueWallMedium"), new Vector2(1050, 45), false, world)); Walls.Add(new Wall(content.Load<Texture2D>("Walls/blueWallMedium"), new Vector2(1050, 555), false, world)); // set cam track cam2D.TrackingBody = playerBody.playerBody; cam2D.EnableTracking = true; // once the load has finished, we use ResetElapsedTime to tell the game's // timing mechanism that we have just finished a very long frame, and that // it should not try to catch up. ScreenManager.Game.ResetElapsedTime(); } base.Activate(instancePreserved); }
/// <summary> /// Load graphics content for the game. /// </summary> public override void Activate(bool instancePreserved) { if (!instancePreserved) { if (content == null) { content = new ContentManager(ScreenManager.Game.Services, "Content"); } gameFont = content.Load <SpriteFont>("gamefont"); bloom = new BloomComponent(ScreenManager.Game); ScreenManager.Game.Components.Add(bloom); cam2D = new Cam2d(ScreenManager.GraphicsDevice); reticle = content.Load <Texture2D>("redReticle"); /// player playerBody = new PlayerBody(content.Load <Texture2D>("redPlayer"), world, content); // drones - can only have two without performance issues { Drones.Add(new SeekerDrone(content.Load <Texture2D>("testArrow"), new Vector2(100, 500), world, content, 10)); Drones.Add(new SeekerDrone(content.Load <Texture2D>("testArrow"), new Vector2(200, 150), world, content, 9)); Drones.Add(new SeekerDrone(content.Load <Texture2D>("testArrow"), new Vector2(300, 200), world, content, 12)); Drones.Add(new SeekerDrone(content.Load <Texture2D>("testArrow"), new Vector2(400, 250), world, content, 14)); Drones.Add(new SeekerDrone(content.Load <Texture2D>("testArrow"), new Vector2(500, 300), world, content, 20)); Drones.Add(new SeekerDrone(content.Load <Texture2D>("testArrow"), new Vector2(600, 350), world, content, 25)); Drones[0].Stationary = true; Drones[5].Stationary = true; } { Squares.Add(new Square(content.Load <Texture2D>("Squares/greenSquare"), new Vector2(0, 50), world)); Squares.Add(new Square(content.Load <Texture2D>("Squares/greenSquare"), new Vector2(400, 50), world)); Squares.Add(new Square(content.Load <Texture2D>("Squares/greenSquare"), new Vector2(240, 350), world)); Squares.Add(new Square(content.Load <Texture2D>("Squares/greenSquare"), new Vector2(300, 400), world)); Squares.Add(new Square(content.Load <Texture2D>("Squares/greenSquare"), new Vector2(300, 550), world)); } int space = 0; int i = 0; for (; i < 11; i++) { Walls.Add(new Wall(content.Load <Texture2D>("Walls/blueWallMedium"), new Vector2(space - 5, 0), true, world)); Walls.Add(new Wall(content.Load <Texture2D>("Walls/blueWallMedium"), new Vector2(space - 5, 600), true, world)); if (i <= 5) { //vertical walls Walls.Add(new Wall(content.Load <Texture2D>("Walls/blueWallMedium"), new Vector2(-50, space + 50), false, world)); Walls.Add(new Wall(content.Load <Texture2D>("Walls/blueWallMedium"), new Vector2(1050, space + 50), false, world)); } space += 100; } Walls.Add(new Wall(content.Load <Texture2D>("Walls/blueWallMedium"), new Vector2(1050, 45), false, world)); Walls.Add(new Wall(content.Load <Texture2D>("Walls/blueWallMedium"), new Vector2(1050, 555), false, world)); // set cam track cam2D.TrackingBody = playerBody.playerBody; cam2D.EnableTracking = true; // once the load has finished, we use ResetElapsedTime to tell the game's // timing mechanism that we have just finished a very long frame, and that // it should not try to catch up. ScreenManager.Game.ResetElapsedTime(); } base.Activate(instancePreserved); }
/// <summary> /// Load graphics content for the game. /// </summary> public override void Activate(bool instancePreserved) { if (!instancePreserved) { if (content == null) { content = new ContentManager(ScreenManager.Game.Services, "Content"); } gameFont = content.Load <SpriteFont>("gamefont"); bloom = new BloomComponent(ScreenManager.Game); ScreenManager.Game.Components.Add(bloom); playerBody = new PlayerBody(content.Load <Texture2D>("redPlayer"), world); dead = content.Load <Texture2D>("DeadScreen/redDeathScreen"); cam2D = new Cam2d(ScreenManager.GraphicsDevice); // neon whip wheel { // instantiate the cirlce body circleBody = BodyFactory.CreateCircle(world, 20.0f / 64, 1f, new Vector2(1000f / 64f, 1000f / 64f)); circleBody.BodyType = BodyType.Static; circleBody.CollisionCategories = Category.Cat2; // fix the circle to the world circleTex = content.Load <Texture2D>("orangeCircle"); FixedRevoluteJoint fixedJoint = new FixedRevoluteJoint(circleBody, Vector2.Zero, circleBody.Position); world.AddJoint(fixedJoint); // create the whips Whips.Add(new Whip(content.Load <Texture2D>("orangeChianLinkSmall"), new Vector2(1000, 1000), new Vector2(1350, 1000f), world)); Whips.Add(new Whip(content.Load <Texture2D>("orangeChianLinkSmall"), new Vector2(1000, 1000), new Vector2(650, 1000), world)); // Whips.Add(new Whip(content.Load<Texture2D>("orangeChianLinkSmall"), new Vector2(1000, 1000), new Vector2(1000, 1350), world)); for (int k = 0; k < Whips.Count; k++) { world.AddJoint(new FixedRevoluteJoint(Whips[k].chainLinks[k], Vector2.Zero, circleBody.Position)); } } // add badies { Badies.Add(new Bady(content.Load <Texture2D>("Badies/orangeBady"), new Vector2(-1, -2), 15, true, 180f, content, world)); Badies.Add(new Bady(content.Load <Texture2D>("Badies/pinkBady"), new Vector2(-3, 0.5f), 8, false, 90f, content, world)); } // add some squares and some walls { int space = 0; for (int i = 0; i < 10; i++) { Walls.Add(new Wall(content.Load <Texture2D>("Walls/blueWallMedium"), new Vector2(space - 5, 0), true, world)); Walls.Add(new Wall(content.Load <Texture2D>("Walls/blueWallMedium"), new Vector2(space - 5, 600), true, world)); Squares.Add(new Square(content.Load <Texture2D>("Squares/greenSquare"), new Vector2(space, 100), world)); Squares.Add(new Square(content.Load <Texture2D>("Squares/pinkSquare"), new Vector2(space + 50, 200), world)); Squares.Add(new Square(content.Load <Texture2D>("Squares/yellowSquare"), new Vector2(space, 300), world)); Squares.Add(new Square(content.Load <Texture2D>("Squares/orangeSquare"), new Vector2(space + 50, 400), world)); Squares.Add(new Square(content.Load <Texture2D>("Squares/greenSquare"), new Vector2(space, 500), world)); if (i <= 5) { //vertical walls Walls.Add(new Wall(content.Load <Texture2D>("Walls/blueWallMedium"), new Vector2(-50, space + 50), false, world)); Walls.Add(new Wall(content.Load <Texture2D>("Walls/blueWallMedium"), new Vector2(1050, space + 50), false, world)); } space += 100; } // extra wall Walls.Add(new Wall(content.Load <Texture2D>("Walls/blueWallMedium"), new Vector2(space + 5, 0), true, world)); Walls.Add(new Wall(content.Load <Texture2D>("Walls/blueWallMedium"), new Vector2(space - 10, 0), true, world)); // Ninja gate need to change the colour of the ninja gate { ninjaGate = new Shape(content.Load <Texture2D>("NinjaWeapons/blueNinjaWheel"), new Vector2((space - 5), 600f), false, world); Shapes.Add(ninjaGate); Shapes[0].shapeBody.AngularVelocity = 10f; // Shapes.Add(new Shape(content.Load<Texture2D>("NinjaWeapons/blueNinjaWheel"),new Vector2((space - 5), 600f),false,world)); world.AddJoint(new FixedRevoluteJoint(Shapes[0].shapeBody, Vector2.Zero, Shapes[0].shapeBody.Position)); } } //add collectables { Collectables.Add(new Collectable(content.Load <Texture2D>("redStar"), new Vector2(0, 25), world)); Collectables.Add(new Collectable(content.Load <Texture2D>("redStar"), new Vector2(900, 25), world)); Collectables.Add(new Collectable(content.Load <Texture2D>("redStar"), new Vector2(900, 625), world)); } // set cam track cam2D.TrackingBody = playerBody.playerBody; cam2D.EnableTracking = true; // once the load has finished, we use ResetElapsedTime to tell the game's // timing mechanism that we have just finished a very long frame, and that // it should not try to catch up. ScreenManager.Game.ResetElapsedTime(); } }
/// <summary> /// Load graphics content for the game. /// </summary> public override void Activate(bool instancePreserved) { if (!instancePreserved) { if (content == null) content = new ContentManager(ScreenManager.Game.Services, "Content"); gameFont = content.Load<SpriteFont>("gamefont"); bloom = new BloomComponent(ScreenManager.Game); ScreenManager.Game.Components.Add(bloom); ParticleManager = new ParticleManager<ParticleState>(1024 * 20, ParticleState.UpdateParticle); cam2D = new Cam2d(ScreenManager.GraphicsDevice); reticle = content.Load<Texture2D>("redReticle"); /// player playerBody = new PlayerBody(content.Load<Texture2D>("redPlayer"), world, content); playerBody.setPostion = new Vector2(-940, -450); // for some reason we have to offet on the X by -120 px. This just get the level bounds to aling with world objects. // I think it's to do with the scale factor when it's turned into a poly. Maybe? :( LevelArena.Add(new Arena(content.Load<Texture2D>("Levels/Delta"), new Vector2(-120f / 64f, 0f), world)); // LEVEL CREATION MUHAHAHAAHAHAH { string line = string.Empty; string [] vals; using (StreamReader sr = new StreamReader("Content/Levels/deltaLevel.txt")) { while ((line = sr.ReadLine()) != null) { vals = line.Split(','); if (vals[0].Equals("greenMine")) { Squares.Add(new Square(content.Load<Texture2D>("Squares/greenSquare"), new Vector2((float)Convert.ToInt32(vals[1]), (float)Convert.ToInt32(vals[2])), world)); } else if(vals[0].Equals("FixedDrone")) { } } } } // set cam track cam2D.TrackingBody = playerBody.playerBody; cam2D.EnableTracking = true; // once the load has finished, we use ResetElapsedTime to tell the game's // timing mechanism that we have just finished a very long frame, and that // it should not try to catch up. ScreenManager.Game.ResetElapsedTime(); } base.Activate(instancePreserved); }
/// <summary> /// Load graphics content for the game. /// </summary> public override void Activate(bool instancePreserved) { if (!instancePreserved) { if (content == null) { content = new ContentManager(ScreenManager.Game.Services, "Content"); } gameFont = content.Load <SpriteFont>("gamefont"); bloom = new BloomComponent(ScreenManager.Game); ScreenManager.Game.Components.Add(bloom); /* * Welcome, Blue, Pink, iniProgress, progressLoadedSFX, * Questions, One, Two, Three, Opo, System, entryPoint; * */ WelcomeSFX = content.Load <SoundEffect>("Audio/SoundFX/Vivi_Tut/Vivi_Welcome_UK_WAV"); BlueSFX = content.Load <SoundEffect>("Audio/SoundFX/Vivi_Tut/Vivi_BlueSquare_UK_WAV"); PinkSFX = content.Load <SoundEffect>("Audio/SoundFX/Vivi_Tut/Vivi_PinkSquare_UK_WAV"); QuestionsSFX = content.Load <SoundEffect>("Audio/SoundFX/Vivi_Tut/Vivi_Questions_UK_WAV"); progressLoadedSFX = content.Load <SoundEffect>("Audio/SoundFX/Vivi_Tut/Vivi_ProgessLoaded_WAV"); iniProgressSFX = content.Load <SoundEffect>("Audio/SoundFX/Vivi_Tut/Vivi_Progress_Tracker_WAV"); OneSFX = content.Load <SoundEffect>("Audio/SoundFX/Vivi_Tut/Vivi_One_WAV"); TwoSFX = content.Load <SoundEffect>("Audio/SoundFX/Vivi_Tut/Vivi_Two_WAV"); ThreeSFX = content.Load <SoundEffect>("Audio/SoundFX/Vivi_Tut/Vivi_Three_WAV"); OpoSFX = content.Load <SoundEffect>("Audio/SoundFX/Vivi_Tut/Vivi_You_are_opo_UK_WAV"); SystemSFX = content.Load <SoundEffect>("Audio/SoundFX/Vivi_Tut/Vivi_System_UK_WAV"); EntryPointSFX = content.Load <SoundEffect>("Audio/SoundFX/Vivi_Tut/Vivi_EntryPoint_WAV"); WelcomeSFXInstance = WelcomeSFX.CreateInstance(); BlueSFXInstance = BlueSFX.CreateInstance(); PinkSFXInstance = PinkSFX.CreateInstance(); QuestionsSFXInstance = QuestionsSFX.CreateInstance(); iniProgressSFXInstance = iniProgressSFX.CreateInstance(); progressLoadedSFXInstance = progressLoadedSFX.CreateInstance(); OneSFXInstance = OneSFX.CreateInstance(); TwoSFXInstance = TwoSFX.CreateInstance(); ThreeSFXInstance = ThreeSFX.CreateInstance(); OpoSFXInstance = OpoSFX.CreateInstance(); SystemSFXInstance = SystemSFX.CreateInstance(); EntryPointSFXInstance = EntryPointSFX.CreateInstance(); UI = new ChoiceDisplay(content.Load <Texture2D>("a-Button"), content.Load <Texture2D>("b-Button"), content.Load <Texture2D>("x-Button"), null, "No, Let's go!.", "Who am I?", "Where am I?!", null, content); UI.Acitve = false; cam2D = new Cam2d(ScreenManager.GraphicsDevice); reticle = content.Load <Texture2D>("redReticle"); /// player playerBody = new PlayerBody(content.Load <Texture2D>("redPlayer"), world, content); playerBody.getSetLaserStatus = false; playerBody.getSetDrawScore = false; playerBody.getSetChoicePoint = false; int space = 0; for (int i = 0; i < 11; i++) { Walls.Add(new Wall(content.Load <Texture2D>("Walls/blueWallMedium"), new Vector2(space - 5, 0), true, world)); Walls.Add(new Wall(content.Load <Texture2D>("Walls/blueWallMedium"), new Vector2(space - 5, 600), true, world)); if (i <= 5) { //vertical walls Walls.Add(new Wall(content.Load <Texture2D>("Walls/blueWallMedium"), new Vector2(-50, space + 50), false, world)); Walls.Add(new Wall(content.Load <Texture2D>("Walls/blueWallMedium"), new Vector2(1050, space + 50), false, world)); } space += 100; } Walls.Add(new Wall(content.Load <Texture2D>("Walls/blueWallMedium"), new Vector2(1050, 45), false, world)); Walls.Add(new Wall(content.Load <Texture2D>("Walls/blueWallMedium"), new Vector2(1050, 555), false, world)); // set cam track cam2D.TrackingBody = playerBody.playerBody; cam2D.EnableTracking = true; // once the load has finished, we use ResetElapsedTime to tell the game's // timing mechanism that we have just finished a very long frame, and that // it should not try to catch up. ScreenManager.Game.ResetElapsedTime(); } base.Activate(instancePreserved); }
/// <summary> /// Load graphics content for the game. /// </summary> public override void Activate(bool instancePreserved) { if (!instancePreserved) { if (content == null) content = new ContentManager(ScreenManager.Game.Services, "Content"); Art.Load(content); gameFont = content.Load<SpriteFont>("gamefont"); ParticleManager = new ParticleManager<ParticleState>(1024 * 20, ParticleState.UpdateParticle); particleArt = content.Load<Texture2D>("Laser"); const int maxGridPoints = 1600; Vector2 gridSpacing = new Vector2((float)Math.Sqrt(1024 * 768 / maxGridPoints)); Rectangle posAndSize = new Rectangle(-75, -20, 1140, 640 ); // Grid = new Grid(this.ScreenManager.GraphicsDevice.Viewport.Bounds, gridSpacing); Grid = new Grid(posAndSize, gridSpacing); bloom = new BloomComponent(ScreenManager.Game); ScreenManager.Game.Components.Add(bloom); area = new Area(content.Load<Texture2D>("pinkArea"),new Vector2(500,500),0f,world); cam2D = new Cam2d(ScreenManager.GraphicsDevice); reticle = content.Load<Texture2D>("redReticle"); /// player playerBody = new PlayerBody(content.Load<Texture2D>("redPlayer"), world, content); Pickupables.Add(new Pickupable(content.Load<Texture2D>("Squares/pinkSquare"), new Vector2(100, 100), world)); Pickupables.Add(new Pickupable(content.Load<Texture2D>("Squares/pinkSquare"), new Vector2(100, 80), world)); Pickupables.Add(new Pickupable(content.Load<Texture2D>("Squares/pinkSquare"), new Vector2(120, 100), world)); Drones.Add(new SeekerDrone(content.Load<Texture2D>("testArrow"), new Vector2(500, 300), world, content, 20)); Drones.Add(new SeekerDrone(content.Load<Texture2D>("testArrow"), new Vector2(600, 350), world, content, 25)); Drones[0].Stationary = true; int space = 0; for (int i = 0; i < 11; i++) { Walls.Add(new Wall(content.Load<Texture2D>("Walls/blueWallMedium"), new Vector2(space - 5, 0), true, world)); Walls.Add(new Wall(content.Load<Texture2D>("Walls/blueWallMedium"), new Vector2(space - 5, 600), true, world)); if (i <= 5) { //vertical walls Walls.Add(new Wall(content.Load<Texture2D>("Walls/blueWallMedium"), new Vector2(-50, space + 50), false, world)); Walls.Add(new Wall(content.Load<Texture2D>("Walls/blueWallMedium"), new Vector2(1050, space + 50), false, world)); } space += 100; } Walls.Add(new Wall(content.Load<Texture2D>("Walls/blueWallMedium"), new Vector2(1050, 45), false, world)); Walls.Add(new Wall(content.Load<Texture2D>("Walls/blueWallMedium"), new Vector2(1050, 555), false, world)); // set cam track cam2D.TrackingBody = playerBody.playerBody; cam2D.EnableTracking = true; // once the load has finished, we use ResetElapsedTime to tell the game's // timing mechanism that we have just finished a very long frame, and that // it should not try to catch up. ScreenManager.Game.ResetElapsedTime(); } base.Activate(instancePreserved); }
/// <summary> /// Load graphics content for the game. /// </summary> public override void Activate(bool instancePreserved) { if (!instancePreserved) { if (content == null) { content = new ContentManager(ScreenManager.Game.Services, "Content"); } gameFont = content.Load <SpriteFont>("gamefont"); bloom = new BloomComponent(ScreenManager.Game); ScreenManager.Game.Components.Add(bloom); cam2D = new Cam2d(ScreenManager.GraphicsDevice); reticle = content.Load <Texture2D>("redReticle"); /// player playerBody = new PlayerBody(content.Load <Texture2D>("redPlayer"), world, content); playerBody.setPostion = new Vector2(900, 100); Squares.Add(new Square(content.Load <Texture2D>("Squares/greenSquare"), new Vector2(-28, 200), world)); //spinning wheel. { Walls.Add(new Wall(content.Load <Texture2D>("Walls/blueWallMedium"), new Vector2(-5, 250), false, world)); Walls.Add(new Wall(content.Load <Texture2D>("Walls/blueWallMedium"), new Vector2(-5, 350), false, world)); // filler Walls.Add(new Wall(content.Load <Texture2D>("Walls/blueWallMedium"), new Vector2(205, 360), false, world)); Walls.Add(new Wall(content.Load <Texture2D>("Walls/blueWallMedium"), new Vector2(205, 250), false, world)); // filler Walls.Add(new Wall(content.Load <Texture2D>("Walls/blueWallMedium"), new Vector2(205, 240), false, world)); Walls.Add(new Wall(content.Load <Texture2D>("Walls/blueWallMedium"), new Vector2(205, 350), false, world)); Walls.Add(new Wall(content.Load <Texture2D>("Walls/blueWallMedium"), new Vector2(160, 190), true, world)); Walls.Add(new Wall(content.Load <Texture2D>("Walls/blueWallMedium"), new Vector2(160, 410), true, world)); spinningWheel = new Shape(content.Load <Texture2D>("Shapes/orangeSpinningWheel"), new Vector2(100, 300), true, false, world); FixedRevoluteJoint fixedJoint = new FixedRevoluteJoint(spinningWheel.shapeBody, Vector2.Zero, spinningWheel.shapeBody.Position); world.AddJoint(fixedJoint); } int space = 0; int k = 260; for (; k < 1000; k += 100) { Walls.Add(new Wall(content.Load <Texture2D>("Walls/blueWallMedium"), new Vector2(k, 190), true, world)); } Walls.Add(new Wall(content.Load <Texture2D>("Walls/blueWallMedium"), new Vector2(k - 65, 190), true, world)); for (int i = 0; i < 11; i++) { Walls.Add(new Wall(content.Load <Texture2D>("Walls/blueWallMedium"), new Vector2(space - 5, 0), true, world)); Walls.Add(new Wall(content.Load <Texture2D>("Walls/blueWallMedium"), new Vector2(space - 5, 600), true, world)); if (i <= 5) { //vertical walls Walls.Add(new Wall(content.Load <Texture2D>("Walls/blueWallMedium"), new Vector2(-50, space + 50), false, world)); Walls.Add(new Wall(content.Load <Texture2D>("Walls/blueWallMedium"), new Vector2(1050, space + 50), false, world)); } space += 100; } Walls.Add(new Wall(content.Load <Texture2D>("Walls/blueWallMedium"), new Vector2(1050, 45), false, world)); Walls.Add(new Wall(content.Load <Texture2D>("Walls/blueWallMedium"), new Vector2(1050, 555), false, world)); // set cam track cam2D.TrackingBody = playerBody.playerBody; cam2D.EnableTracking = true; // once the load has finished, we use ResetElapsedTime to tell the game's // timing mechanism that we have just finished a very long frame, and that // it should not try to catch up. ScreenManager.Game.ResetElapsedTime(); } base.Activate(instancePreserved); }
/// <summary> /// Load graphics content for the game. /// </summary> public override void Activate(bool instancePreserved) { if (!instancePreserved) { if (content == null) content = new ContentManager(ScreenManager.Game.Services, "Content"); gameFont = content.Load<SpriteFont>("gamefont"); bloom = new BloomComponent(ScreenManager.Game); ScreenManager.Game.Components.Add(bloom); /* * Welcome, Blue, Pink, iniProgress, progressLoadedSFX, Questions, One, Two, Three, Opo, System, entryPoint; * */ WelcomeSFX = content.Load<SoundEffect>("Audio/SoundFX/Vivi_Tut/Vivi_Welcome_UK_WAV"); BlueSFX = content.Load<SoundEffect>("Audio/SoundFX/Vivi_Tut/Vivi_BlueSquare_UK_WAV"); PinkSFX = content.Load<SoundEffect>("Audio/SoundFX/Vivi_Tut/Vivi_PinkSquare_UK_WAV"); QuestionsSFX = content.Load<SoundEffect>("Audio/SoundFX/Vivi_Tut/Vivi_Questions_UK_WAV"); progressLoadedSFX = content.Load<SoundEffect>("Audio/SoundFX/Vivi_Tut/Vivi_ProgessLoaded_WAV"); iniProgressSFX = content.Load<SoundEffect>("Audio/SoundFX/Vivi_Tut/Vivi_Progress_Tracker_WAV"); OneSFX = content.Load<SoundEffect>("Audio/SoundFX/Vivi_Tut/Vivi_One_WAV"); TwoSFX = content.Load<SoundEffect>("Audio/SoundFX/Vivi_Tut/Vivi_Two_WAV"); ThreeSFX = content.Load<SoundEffect>("Audio/SoundFX/Vivi_Tut/Vivi_Three_WAV"); OpoSFX = content.Load<SoundEffect>("Audio/SoundFX/Vivi_Tut/Vivi_You_are_opo_UK_WAV"); SystemSFX = content.Load<SoundEffect>("Audio/SoundFX/Vivi_Tut/Vivi_System_UK_WAV"); EntryPointSFX = content.Load<SoundEffect>("Audio/SoundFX/Vivi_Tut/Vivi_EntryPoint_WAV"); WelcomeSFXInstance = WelcomeSFX.CreateInstance(); BlueSFXInstance = BlueSFX.CreateInstance(); PinkSFXInstance = PinkSFX.CreateInstance(); QuestionsSFXInstance = QuestionsSFX.CreateInstance(); iniProgressSFXInstance = iniProgressSFX.CreateInstance(); progressLoadedSFXInstance = progressLoadedSFX.CreateInstance(); OneSFXInstance = OneSFX.CreateInstance(); TwoSFXInstance = TwoSFX.CreateInstance(); ThreeSFXInstance = ThreeSFX.CreateInstance(); OpoSFXInstance = OpoSFX.CreateInstance(); SystemSFXInstance = SystemSFX.CreateInstance(); EntryPointSFXInstance = EntryPointSFX.CreateInstance(); UI = new ChoiceDisplay(content.Load<Texture2D>("a-Button"), content.Load<Texture2D>("b-Button"), content.Load<Texture2D>("x-Button"), null, "No, Let's go!.", "Who am I?", "Where am I?!", null, content); UI.Acitve = false; cam2D = new Cam2d(ScreenManager.GraphicsDevice); reticle = content.Load<Texture2D>("redReticle"); /// player playerBody = new PlayerBody(content.Load<Texture2D>("redPlayer"), world, content); playerBody.getSetLaserStatus = false; playerBody.getSetDrawScore = false; playerBody.getSetChoicePoint = false; int space = 0; for (int i = 0; i < 11; i++) { Walls.Add(new Wall(content.Load<Texture2D>("Walls/blueWallMedium"), new Vector2(space - 5, 0), true, world)); Walls.Add(new Wall(content.Load<Texture2D>("Walls/blueWallMedium"), new Vector2(space - 5, 600), true, world)); if (i <= 5) { //vertical walls Walls.Add(new Wall(content.Load<Texture2D>("Walls/blueWallMedium"), new Vector2(-50, space + 50), false, world)); Walls.Add(new Wall(content.Load<Texture2D>("Walls/blueWallMedium"), new Vector2(1050, space + 50), false, world)); } space += 100; } Walls.Add(new Wall(content.Load<Texture2D>("Walls/blueWallMedium"), new Vector2(1050, 45), false, world)); Walls.Add(new Wall(content.Load<Texture2D>("Walls/blueWallMedium"), new Vector2(1050, 555), false, world)); // set cam track cam2D.TrackingBody = playerBody.playerBody; cam2D.EnableTracking = true; // once the load has finished, we use ResetElapsedTime to tell the game's // timing mechanism that we have just finished a very long frame, and that // it should not try to catch up. ScreenManager.Game.ResetElapsedTime(); } base.Activate(instancePreserved); }