Exemplo n.º 1
0
 public void Update()
 {
     Volume.Update();
     Pitch.Update();
     Pan.Update();
     Music.Volume = SoundLoader.MasterVolume * SoundLoader.MusicMasterVolume * Volume;
     Music.Pitch  = Pitch;
     Music.Pan    = Pan;
 }
Exemplo n.º 2
0
 public override void Update()
 {
     Frame += GetTimeMod();
     Angle += GetTimeMod() * AngleSpeed;
     AngleSpeed.Update(GetTimeMod());
     if (Frame.Done)
     {
         Destroy();
     }
 }
Exemplo n.º 3
0
        public override void Update(Scene scene)
        {
            base.Update(scene);

            Scroll.Update();

            if (Dirty)
            {
                Init();
            }
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
        /*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();
        }
Exemplo n.º 6
0
 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();
     }
 }
Exemplo n.º 7
0
 public override void Update()
 {
     Lerp.Update();
 }