Exemplo n.º 1
0
        /// <summary>
        /// Constructs a new particle emitter object.
        /// </summary>
        public ParticleEmitter(ParticleSystem particleSystem,
                               float particlesPerSecond, Vector3 initialPosition)
        {
            this.particleSystem = particleSystem;

            timeBetweenParticles = 1.0f / particlesPerSecond;

            previousPosition = initialPosition;
        }
Exemplo n.º 2
0
        public override void Initialize()
        {
            // Components
            var services = Game.Services;

            var hudComponent = new HUDComponent(gameInstance);
            Game.Components.Add(hudComponent);
            Game.AddService(typeof(HUDComponent), hudComponent);

            var carControlComponent = new CarControlComponent(gameInstance);
            Game.Components.Add(carControlComponent);
            Game.AddService(typeof(CarControlComponent), carControlComponent);

            var triggerManager = new TriggerManager(gameInstance);
            Game.Components.Add(triggerManager);
            Game.AddService(typeof(TriggerManager), triggerManager);

            // Particle systems

            plasmaSystem = new PlasmaParticleSystem(gameInstance, content);
            Game.Components.Add(plasmaSystem);
            particleSystems.Add(plasmaSystem);

            redSystem = new RedPlasmaParticleSystem(gameInstance, content);
            Game.Components.Add(redSystem);
            particleSystems.Add(redSystem);

            yellowSystem = new YellowPlasmaParticleSystem(gameInstance, content);
            Game.Components.Add(yellowSystem);
            particleSystems.Add(yellowSystem);

            greenSystem = new GreenParticleSystem(gameInstance, content);
            Game.Components.Add(greenSystem);
            particleSystems.Add(greenSystem);

            airParticles = new AirParticleSystem(gameInstance, content);
            Game.Components.Add(airParticles);
            particleSystems.Add(airParticles);

            thunderParticleSystem = new ThunderParticleSystem(gameInstance, content);
            Game.Components.Add(thunderParticleSystem);
            particleSystems.Add(thunderParticleSystem);

            rainSystem = new RainParticleSystem(gameInstance, content);
            Game.Components.Add(rainSystem);
            particleSystems.Add(rainSystem);

            smokeSystem = new SmokeCloudParticleSystem(gameInstance, content);
            Game.Components.Add(smokeSystem);
            particleSystems.Add(smokeSystem);

            fireflySystem = new FireflySystem(gameInstance, content);
            Game.Components.Add(fireflySystem);
            particleSystems.Add(fireflySystem);

            dustSystem = new DustParticleSystem(gameInstance, content);
            Game.Components.Add(dustSystem);
            particleSystems.Add(dustSystem);

            fireSmokeSystem = new SmokePlumeParticleSystem(gameInstance, content);
            Game.Components.Add(fireSmokeSystem);
            particleSystems.Add(fireSmokeSystem);

            fireSystem = new FireParticleSystem(gameInstance, content);
            Game.Components.Add(fireSystem);
            particleSystems.Add(fireSystem);

            pauseMenu = new PauseMenu(gameInstance);
            pauseMenu.ChangeResolution();
            pauseMenu.Enabled = false;
            Game.Components.Add(pauseMenu);

            gameOverMenu = new GameOverMenu(gameInstance);
            gameOverMenu.ChangeResolution();
            gameOverMenu.Enabled = false;
            Game.Components.Add(gameOverMenu);

            //dustSystem.Enabled = false;
            //rainSystem.Enabled = false;
            //smokeSystem.Enabled = false;

            base.Initialize();
        }