Example #1
0
        public override void Loop(MovingObject pShip)
        {
            InputStates.Clear();

            if ((TargetShip.Position - pShip.Position).Length > 16)             // chase the player ship if it gets too far
            {
                Targets.Clear();
                Targets.Add(TargetShip.Position);
            }
            else if (Targets.Count == 0)             // face the same way as the player ship once you reach it
            {
                InputStates.Left  = Methods.AngleDifference(pShip.Angle, TargetShip.Angle) < -15;
                InputStates.Right = Methods.AngleDifference(pShip.Angle, TargetShip.Angle) > 15;
            }

            InputStates.Add(MoveToNextTarget(pShip));
            InputStates.DetectPresses();
        }
Example #2
0
        public override void Loop(MovingObject pShip)
        {
            if (Methods.Random.Next(32) == 0)
            {
                InputStates.Clear();

                if (Methods.Random.Next() > 0)
                {
                    InputStates.Left = true;
                }
                else
                {
                    InputStates.Right = true;
                }

                InputStates.Up = true;
            }
        }
Example #3
0
 private static bool Prefix(InputStates inputStates)
 {
     inputStates.Clear(InputAction.Grip);
     return(true);
 }