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(); }
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; }
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); }