public void Update() { Volume.Update(); Pitch.Update(); Pan.Update(); Music.Volume = SoundLoader.MasterVolume * SoundLoader.MusicMasterVolume * Volume; Music.Pitch = Pitch; Music.Pan = Pan; }
public override void Update() { Frame += GetTimeMod(); Angle += GetTimeMod() * AngleSpeed; AngleSpeed.Update(GetTimeMod()); if (Frame.Done) { Destroy(); } }
public override void Update(Scene scene) { base.Update(scene); Scroll.Update(); if (Dirty) { Init(); } }
public override void Update(GameTime gameTime) { UpdateTimeModifier(); Menu.Update(this); Menu.HandleInput(this); TitleSM.Update(); MorphoFlash.Update(TimeModCurrent); TextFlash.Update(TimeModCurrent); UpdateProtoEffects(); GroundVelocityBase.Update(TimeModCurrent); MorphoPositionBase.Update(TimeModCurrent); MorphoHeight.Update(TimeModCurrent); CastleHeight.Update(TimeModCurrent); GroundOffset += GroundVelocity; foreach (var particle in GroundParticles) { particle.Position += GroundVelocity; particle.Update(this); } foreach (var particle in Particles) { particle.Update(this); } GroundParticles.RemoveAll(x => x.ProtoEffect.Destroyed); Particles.RemoveAll(x => x.ProtoEffect.Destroyed); if (MorphoHeight.Value >= 60 && Frame % 6 == 0) { var direction = Vector2.Normalize(MorphoFacing); var lateral = direction.TurnRight(); var offset = direction * 32 + lateral * (Frame % 12 == 0 ? -16 : +16); var lifetime = 30; var velocity = Util.AngleToVector(Random.NextAngle()) * 10; var particle = new ParticleGround(new Explosion(this, SpriteLoader.Instance.AddSprite("content/effect_moon_big"), lifetime) { Angle = Util.VectorToAngle(GroundVelocity), }, MorphoPosition + offset); particle.Offset.Set(velocity, LerpHelper.Linear, lifetime); GroundParticles.Add(particle); } MenuCursor = Menu.GetMouseOver(InputState.MouseX, InputState.MouseY); }
/*private Color GetTextColor(int index) * { * string text = Amount.ToString(); * float width = 8; * float center = (float)LerpHelper.Quadratic(-width, text.Length + width, Frame.GetSubSlide(0, 30)); * float dist = Math.Abs(index - center); * return Color.Lerp(Color.Gold, Color.Black, (float)LerpHelper.QuadraticIn(0, 1, MathHelper.Clamp(dist / width, 0, 1))); * }*/ public override void Update() { base.Update(); if (Frame.Done) { Destroy(); } Flicker.Update(); FlickerTime += Flicker; if (FlickerTime < 0 || FlickerTime > 1) { FlickerTime = Util.PositiveMod(FlickerTime, 1); } if (Frame.Slide > 0.8f) { Flicker.Set(0.5f, LerpHelper.Linear, Frame.EndTime * 0.2f); } Text.Update(); }
public override void Update() { Angle.Update(GetTimeMod()); Scale.Update(GetTimeMod()); ScaleFlicker.Update(GetTimeMod()); Flicker.Update(GetTimeMod()); ShouldDestroy.Update(GetTimeMod()); ScaleFlickerTime += ScaleFlicker; if (ScaleFlickerTime < 0 || ScaleFlickerTime > 1) { ScaleFlickerTime = Util.PositiveMod(ScaleFlickerTime, 1); } FlickerTime += Flicker; if (FlickerTime < 0 || FlickerTime > 1) { FlickerTime = Util.PositiveMod(FlickerTime, 1); } if (ShouldDestroy) { Destroy(); } }
public override void Update() { Lerp.Update(); }