Exemplo n.º 1
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.º 2
0
 public override void Update(GameTime gameTime)
 {
     Menu.Update(this);
     Menu.HandleInput(this);
 }