Ejemplo n.º 1
0
        public override void Update(uint time, int ticksPassed)
        {
            if (firing)
            {
                Character.Fire(time);
            }

            Physics.Update(ticksPassed, Services.Game.Level);
            Character.Update(time, ticksPassed);
        }
Ejemplo n.º 2
0
        public override void Update(uint time, int ticksPassed)
        {
            if (updateTimer.Update(time))
            {
                UpdateTarget(time);
            }

            if (Target != null && CanSeeTarget(Target))
            {
                if (!InFiringRange(Target))
                {
                    MoveTowardsTarget();
                }
                else
                {
                    Character.AimAt(Target.Location.ToPoint());
                    if (Character.Weapon.ReloadNeeded)
                    {
                        MoveToCover();
                        Character.Weapon.Reload(time);
                    }
                    else
                    {
                        if (fireTimer.Update(time))
                        {
                            Character.Fire(time, Accuracy);
                        }
                    }
                }
            }

            Physics.Update(ticksPassed, Services.Game.Level);
            Physics.Impulse = Vector.Zero;

            Character.Update(time, ticksPassed);
        }