Пример #1
0
        /// <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");
                }



                bloom = new BloomComponent(ScreenManager.Game);
                ScreenManager.Game.Components.Add(bloom);


                cam2D = new Cam2d(ScreenManager.GraphicsDevice);
                //    cam2D.MoveCamera(new Vector2(1024 / 2, 768 / 2));
                playerSpwan = content.Load <Texture2D>("redPlayer");
                blueWall    = content.Load <Texture2D>("Walls/blueWallMedium");

                // set cam track
                // don't need to for the moment



                // 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();
            }
        }
Пример #2
0
        /// <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);
        }
Пример #3
0
        /// <summary>
        /// Loads graphics content for this screen. The background texture is quite
        /// big, so we use our own local ContentManager to load it. This allows us
        /// to unload before going from the menus into the game itself, wheras if we
        /// used the shared ContentManager provided by the Game class, the content
        /// would remain loaded forever.
        /// </summary>
        public override void Activate(bool instancePreserved)
        {
            if (!instancePreserved)
            {
                if (content == null)
                {
                    content = new ContentManager(ScreenManager.Game.Services, "Content");
                }
                bloom = new BloomComponent(ScreenManager.Game);
                ScreenManager.Game.Components.Add(bloom);
                bloom.Settings = BloomSettings.PresetSettings[bloomSettingsIndex];


                backgroundTexture = content.Load <Texture2D>("Logo");
            }
        }
Пример #4
0
        public override void Activate(bool instancePreserved)
        {
            if (!instancePreserved)
            {
                if (content == null)
                {
                    content = new ContentManager(ScreenManager.Game.Services, "Content");
                }
                bloom = new BloomComponent(ScreenManager.Game);
                ScreenManager.Game.Components.Add(bloom);
                tex = content.Load <Texture2D>("DeadScreen/redDeathScreen");


                UI        = new ChoiceDisplay(null, null, null, null, null, null, null, null, content);
                UI.setSub = "Press A to respawn.";

                ScreenManager.Game.ResetElapsedTime();
            }


            base.Activate(instancePreserved);
        }
Пример #5
0
        /// <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();
            }
        }
Пример #7
0
        /// <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);
        }
Пример #8
0
        /// <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);
        }