Ejemplo n.º 1
0
        /// <summary>
        /// The robot follows an enemy but keeps a distance
        /// </summary>
        private void Chase()
        {
            const int distanceOffset = 100;

            var bearingVec = new Vector2D(_Robot.Enemy.Position, _Robot.Position);

            bearingVec.Normalize();
            bearingVec *= distanceOffset;
            var closestFollowPos        = _Robot.Enemy.Position + bearingVec;
            var closestFollowTrajectory = new Vector2D(_Robot.Position, closestFollowPos);

            Steering.Steer(_Robot, closestFollowTrajectory);
        }
Ejemplo n.º 2
0
        private void Ram()
        {
            var ramVector = new Vector2D(_Robot.Position, _Robot.Enemy.Position);

            Steering.Steer(_Robot, ramVector);
        }