/// <summary> /// Initializes the Engine Component. /// </summary> public override void Initialize() { // Aura has 2 horizontal directions. for (var i = 0; i < 5; i++) { var horizontalVelocity = MathsHelper.NextFloat(); this.velocities[Direction.Right].Add(new Vector2(horizontalVelocity, 0f)); this.velocities[Direction.Left].Add(new Vector2(-horizontalVelocity, 0f)); } }
/// <summary> /// Gets the particle. /// </summary> /// <returns> /// A new particle. /// </returns> public override IParticle GetParticle() { var velocity = new Vector2(0f, -(MathsHelper.NextFloat() / 10)); var lifespan = MathsHelper.Random(60, 120); var sourceRect = new Rectangle(0, 0, this.ParticleSize, this.ParticleSize); return(new Particle(this, this.GetBoundPosition(), velocity, 0f, 0f, this.Scale, lifespan, sourceRect, recycle: true, fadeIn: false, fadeOut: true, trackParent: false, shrink: true) { Texture = TextureManager.GetColorTexture(lavaColor) }); }
/// <summary> /// Gets the particle. /// </summary> /// <returns> /// A new particle. /// </returns> public override IParticle GetParticle() { var position = this.Position; var velocity = new Vector2(0f, -0.125f); var lifespan = MathsHelper.Random(20, 40); var sourceRect = new Rectangle(0, 0, ParticleEffectConstants.Large, ParticleEffectConstants.Large); var rotationSpeed = MathsHelper.NextFloat() / 10; return(new Particle(this, position, velocity, 0f, rotationSpeed, this.Scale, lifespan, sourceRect, recycle: false, fadeIn: false, fadeOut: true, trackParent: false, shrink: true) { Texture = TextureManager.GetColorTexture(Color.BlanchedAlmond) }); }
/// <summary> /// Gets the particle. /// </summary> /// <returns> /// A new particle. /// </returns> public override IParticle GetParticle() { var position = this.Position; position.X += MathsHelper.Random(-5, 4); position.Y += MathsHelper.Random(-4, -2); var velocity = this.velocities[MathsHelper.Random(this.velocities.Count)]; velocity.Y = -(MathsHelper.NextFloat() / 6); var lifespan = MathsHelper.Random(20, 40); var sourceRect = new Rectangle(0, 0, ParticleEffectConstants.Massive, ParticleEffectConstants.Massive); return(new Particle(this, position, velocity, 0f, 0f, this.Scale, lifespan, sourceRect, recycle: true, fadeIn: true, fadeOut: true, trackParent: false, shrink: true) { Texture = TextureManager.GetColorTexture(Color.White) }); }
/// <summary> /// Initializes the Engine Component. /// </summary> public override void Initialize() { var verticalVelocity = MathsHelper.NextFloat() * 2; var horizontalVelocity = MathsHelper.NextFloat(); horizontalVelocity -= 0.7f; if (horizontalVelocity <= 0f) { horizontalVelocity = 0.1f; } this.velocities = new List <Vector2> { new Vector2(horizontalVelocity, verticalVelocity), new Vector2(0f, verticalVelocity), new Vector2(-horizontalVelocity, verticalVelocity) }; base.Initialize(); }
/// <summary> /// Initializes the Engine Component. /// </summary> public override void Initialize() { var velocity = MathsHelper.NextFloat(); velocity -= 0.7f; if (velocity <= 0f) { velocity = 0.1f; } this.velocities = new List <Vector2> { new Vector2(velocity, velocity), new Vector2(velocity, -velocity), new Vector2(-velocity, -velocity), new Vector2(-velocity, velocity) }; base.Initialize(); }