Exemplo n.º 1
0
        public AsteroidEmitter(Scene scene,
                               String[] assets,
                               IWorldObject target,
                               ExplosionManager explosionManager)
            : base(scene)
        {
            Verify.That(target).Named("target").IsNotNull();
            _target = target;

            _explosionManager = explosionManager;
            _assets = assets;
            _random = new Random();
        }
Exemplo n.º 2
0
 public Asteroid(Scene scene,
                 String assetName,
                 Vector3 rotationAmount,
                 Single scale,
                 TimeSpan lifetime,
                 ExplosionManager explosionManager)
     : base(scene, assetName)
 {
     _rotationAmount = rotationAmount;
     _lifetime = lifetime;
     _explosionManager = explosionManager;
     _transition = BuildTransition.Between(0.0f, 1.0f)
                                  .Within(TimeSpan.FromSeconds(0.8f))
                                  .InterpolateWith(MathHelper.Lerp)
                                  .Instance();
     _scale = scale;
     _world = Matrix.Identity;
 }
Exemplo n.º 3
0
        private void InitializeParticleSystems()
        {
            var fireParticleSystem = new ExplosionParticleSystem(this, BlendState.Additive, 100, "textures/explosion");
            fireParticleSystem.AddAffector(new VelocityAffector(Vector3.Down));
            AddComponent(fireParticleSystem, "Sprites");

            var smokeParticleSystem = new ExplosionParticleSystem(this, BlendState.NonPremultiplied, 100, "textures/smoke");
            smokeParticleSystem.AddAffector(new VelocityAffector(Vector3.Down));
            AddComponent(smokeParticleSystem, "Sprites");

            _explosionManager = new ExplosionManager(fireParticleSystem, smokeParticleSystem);
        }