public void ProduceParticle(Vector3 Position) { if (CanProduceParticles) { ParticleManager.CreateParticle(Position, Logic.RLerp(MinVelocity.get(), MaxVelocity.get()), new Color(Logic.RLerp(MinColor.get(), MaxColor.get())), MathHelper.Lerp(MinSize.get(), MaxSize.get(), Rand.F()), ParticleType.get()); } }
public void ProduceParticle(ref Vector3 Position, ref Matrix Rotation, float Scale, float ColorMult) { if (CanProduce) { ParticleManager.CreateParticle(Position + Vector3.Transform(this.Position * Scale / 100, Rotation) , Vector3.Transform(Logic.RLerp(MinVelocity, MaxVelocity) * Scale / 100, Rotation), new Color(Logic.RLerp(MinColor, MaxColor) * ColorMult / 3), MathHelper.Lerp(MinSize, MaxSize, Rand.F()) * Scale / 100, ParticleType); } }
void StarChange() { r = new Random(Seed.get()); Stars = new Star[StarCount.get()]; for (int i = 0; i < StarCount.get(); i++) { Stars[i] = new Star(Logic.RLerp(MinRadius.get(), MaxRadius.get(), r) * Vector3.Normalize(Rand.V3()), Logic.RLerp(MinSize.get(), MaxSize.get(), r), new Color(Logic.RLerp(MinColor.get(), MaxColor.get(), r))); } }
public override void Update(GameTime gameTime) { Timer += gameTime.ElapsedGameTime.Milliseconds; for (int i = 0; i < ChunkCount; i++) { FlamingChunk c = Chunks[i]; if (Timer < c.StartTime + FlamingChunk.LifeTime) { ParticleManager.CreateParticle(c.GlowPosition, Vector3.Zero, new Color(Logic.RLerp(c.MinColor, c.MaxColor)), c.Size * c.GlowSizeMult * (1 - (Timer - c.StartTime) / (float)FlamingChunk.LifeTime), 1); } } AlternatingControll = !AlternatingControll; if (!AlternatingControll) { return; } while (ChunkCount > 0 && Timer > Chunks[0].StartTime + FlamingChunk.LifeTime) { Destroy(0); } if (Timer > 300000) { Timer = 0; PreviousTimer = 0; ChunkCount = 0; } else { if (ChunkCount > 0) { for (int i = 0; i < ChunkCount; i++) { Chunks[i].Update(Timer, PreviousTimer); } PreviousTimer = Timer; } else { Timer = 0; PreviousTimer = 0; } } }
public override void Update(GameTime gameTime) { Timer += gameTime.ElapsedGameTime.Milliseconds; if (Timer > CinematicDelay.get()) { Timer -= CinematicDelay.get(); if (!NoInterpolate.get()) { ParticleManager.CreateParticle(Position.get(), Logic.RLerp(MinVelocity.get(), MaxVelocity.get()), new Color(Logic.RLerp(MinColor.get(), MaxColor.get()) / 3), MathHelper.Lerp(MinSize.get(), MaxSize.get(), Rand.F()), ParticleType.get()); } else { ParticleManager.CreateParticle(Position.get(), Logic.RLerp(MinVelocity.get(), MaxVelocity.get()), new Color(MinColor.get() / 3), MathHelper.Lerp(MinSize.get(), MaxSize.get(), Rand.F()), ParticleType.get()); } } base.Update(gameTime); }
public void Update(int Timer, int PreviousTimer) { if (Timer < StartTime + LifeTime) { for (int i = PreviousTimer; i < Timer - Timer % 50; i += 50) { ParticleManager.CreateParticle(GetPosition(i), Vector3.Zero, new Color(Logic.RLerp(MinColor, MaxColor)), Size * ParticleSizeMult * (1 - (Timer - StartTime) / (float)LifeTime), ParticleType); } Vector3 NewRotation = StartingRotation + RotationSpeed / 10 * (Timer - StartTime); WorldMatrix = Matrix.CreateFromYawPitchRoll(NewRotation.X, NewRotation.Y, NewRotation.Z) * Matrix.CreateScale(Size / ModelSize * (1 - (Timer - StartTime) / (float)LifeTime)) * Matrix.CreateTranslation(GlowPosition = GetPosition(Timer)); } }
public void Update(int Timer) { FlareSystem.AddLightning(Position, new Color(Logic.RLerp(MinColor, MaxColor) * (1 - (Timer - StartTime) / (float)LifeTime)), Size, Spread, Lines, LinePop); }