//constructor
        public MercedesSLRMclaren(ref GraphicsDeviceManager graphics, ContentManager currentContentLoader, ref SpriteBatch spriteBatch, Vector3 start, InputHandler input, ref SpriteFont currentFont, ref Model carModel, Game game)
            : base(ref graphics, start, input)
        {
            //smoke particle system
            smoke           = new SmokePlumeParticleSystem(game, currentContentLoader, graphics.GraphicsDevice);
            smoke.DrawOrder = 100;
            game.Components.Add(smoke);

            //car model
            this.carModel = carModel;

            //gearbox and motor of the car
            changeGearBoxToAutomatic();

            //create Gauge
            guageTexture     = currentContentLoader.Load <Texture2D>("Textures//Gauges//Speedo");
            needleTexture    = currentContentLoader.Load <Texture2D>("Textures//Gauges//SpeedoNeedle");
            lightTexture     = currentContentLoader.Load <Texture2D>("Textures//Gauges//SpeedoGearLight");
            canister         = currentContentLoader.Load <Texture2D>("Textures//Gauges//NOScanister");
            this.spriteBatch = spriteBatch;
            this.currentFont = currentFont;
            createGauge(graphics.GraphicsDevice.Viewport);

            //collision data
            collisionSphere = new BoundingSphere(position / 20, 0.30f);
            collisionBox    = CreateBoundingBox();
            collisionSphere = CreateBoundingSphere();

            //sound data
            sound = new SoundEffectPlayer(currentContentLoader, this, "Sound//SoundEffects//Mercedes Mclaren SLR");

            //car scale
            carScale = 0.05f;
        }
        public FireObject(ContentManager content, FireParticleSystem fireSystem, SmokePlumeParticleSystem fireSmokeSystem, Vector3 firePosition, Vector3 smokeOffset)
            : base(firePosition, Color.Red.ToVector3(), 400)
        {
            this.fireSystem      = fireSystem;
            this.fireSmokeSystem = fireSmokeSystem;

            fireEmitter        = new ParticleEmitter(fireSystem, 100, firePosition);
            fireEmitter.Origin = firePosition;

            fireSmokeEmitter        = new ParticleEmitter(fireSmokeSystem, 100, firePosition + smokeOffset);
            fireSmokeEmitter.Origin = firePosition + smokeOffset;

            this.smokeOffset = smokeOffset;
            Model            = content.Load <Model>(@"Models\light");
        }
        //constructor
        public FordMustangGT500(ref GraphicsDeviceManager graphics, ContentManager currentContentLoader, ref SpriteBatch spriteBatch, Vector3 start, InputHandler input, ref SpriteFont currentFont, ref Model carModel, Game game)
            : base(ref graphics, start, input)
        {
            //smoke particle system
            smoke           = new SmokePlumeParticleSystem(game, currentContentLoader, graphics.GraphicsDevice);
            smoke.DrawOrder = 100;
            game.Components.Add(smoke);

            //car model
            this.carModel = carModel;

            //gear box and current motor of car
            changeGearBoxToAutomatic();

            //create Gauge
            guageTexture     = currentContentLoader.Load <Texture2D>("Textures//Gauges//Speedo");
            needleTexture    = currentContentLoader.Load <Texture2D>("Textures//Gauges//SpeedoNeedle");
            lightTexture     = currentContentLoader.Load <Texture2D>("Textures//Gauges//SpeedoGearLight");
            canister         = currentContentLoader.Load <Texture2D>("Textures//Gauges//NOScanister");
            this.spriteBatch = spriteBatch;
            this.currentFont = currentFont;
            createGauge(graphics.GraphicsDevice.Viewport);

            //collision data
            collisionSphere = new BoundingSphere(position / 20, 0.30f);
            collisionBox    = CreateBoundingBox();
            collisionSphere = CreateBoundingSphere();

            //sound data
            sound = new SoundEffectPlayer(currentContentLoader, this, "Sound//SoundEffects//Mitsubishi Lancer Evo X");

            //apply rotation
            carGlobalRotation = MathHelper.ToRadians(-90);

            //set wheel bone
            this.frontWheelRight = carModel.Bones["polySurface2927"];
            this.frontWheelLeft  = carModel.Bones["polySurface2926"];
            this.backWheelRight  = carModel.Bones["polySurface2928"];
            this.backWheelLeft   = carModel.Bones["polySurface2925"];

            //car scale
            carScale = 0.05f;
        }
Beispiel #4
0
        public AlienShooterGame()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";
            TargetElapsedTime     = TimeSpan.FromTicks(333333);

            // you can choose whether you want a landscape or portrait
            // game by using one of the two helper functions defined below
            InitializePortraitGraphics();
            // InitializeLandscapeGraphics();

            // Create the screen manager component.
            screenManager = new ScreenManager(this);
            Components.Add(screenManager);

            //Add Explosions and Smoke Game Components to AlienShooter
            explosionSmokeParticleSystem = new ExplosionSmokeParticleSystem(this, 2);
            Components.Add(explosionSmokeParticleSystem);
            explosionParticleSystem = new ExplosionParticleSystem(this, 1);
            Components.Add(explosionParticleSystem);
            smokePlumeParticleSystem = new SmokePlumeParticleSystem(this, 8);
            Components.Add(smokePlumeParticleSystem);

            // attempt to deserialize the screen manager from disk. if that
            // fails, we add our default screens.
            if (!screenManager.DeserializeState())
            {
                // Activate the first screens.
                screenManager.AddScreen(new BackgroundScreen(), null);
                screenManager.AddScreen(new MainMenuScreen(), null);
            }
            //Imeplement tombstoning support globally if managing
            //multiple state objects across game gamescreens
            PhoneApplicationService.Current.Activated   += AlienGame_Activated;
            PhoneApplicationService.Current.Deactivated += AlienGame_Deactivated;
        }