예제 #1
0
        public override void Update()
        {
            base.Update();
            if (Hit && CurrentAnimation != "Explosion")
            {
                StartAnimation("Explosion");
                Location.Z = ShooterLevel.ExplosionZ;
                Motion     = new StraightMotion(new Vector2D(0, 0));
            }

            Destroyed = Hit && !Started;

            if (Hit)
            {
                return;
            }

            SeekMotion motion = (SeekMotion)Motion;

            if (Hit && motion.Target != null)
            {
                ((Dino)motion.Target).Locked = false;
            }

            CurrentAnimation = Math.Abs((Math.Round(motion.Angle / 0.4188f) - 16) % 16).ToString();

            // Missiles do not pick a new target
            if (motion.Target != null && ((Dino)motion.Target).Dead)
            {
                motion.Target = null;
            }
        }
예제 #2
0
        public override void Update()
        {
            base.Update();
            if (Hit && CurrentAnimation != "Explosion")
            {
                StartAnimation("Explosion");
                Location.Z = ShooterLevel.ExplosionZ;
                Motion = new StraightMotion(new Vector2D(0, 0));
            }

            Destroyed = Hit && !Started;

            if (Hit) return;

            SeekMotion motion = (SeekMotion)Motion;

            if (Hit && motion.Target != null) ((Dino)motion.Target).Locked = false;

            CurrentAnimation = Math.Abs((Math.Round(motion.Angle / 0.4188f) - 16) % 16).ToString();

            // Missiles do not pick a new target
            if (motion.Target != null && ((Dino)motion.Target).Dead) motion.Target = null;
        }