private void InitializeSecondaryCharacter(DynamicCharacter character, GameObject[] obstacles)
    {
        var priority = new PriorityMovement
        {
            Character = character.KinematicData
        };

        foreach (var obstacle in obstacles)
        {

            //TODO: add your AvoidObstacle movement here
            //avoidObstacleMovement = new DynamicAvoidObstacle(obstacle)
            //{
            //    MaxAcceleration = MAX_ACCELERATION,
            //    AvoidMargin = AVOID_MARGIN,
            //    MaxLookAhead = MAX_LOOK_AHEAD,
            //    Character = character.KinematicData,
            //    MovementDebugColor = Color.magenta
            //};

            //priority.Movements.Add(avoidObstacleMovement);
        }

        foreach (var otherCharacter in this.Characters)
        {
            if (otherCharacter != character)
            {
                //TODO: add your avoidCharacter movement here
                //var avoidCharacter = new DynamicAvoidCharacter(otherCharacter.KinematicData)
                //{
                //    Character = character.KinematicData,
                //    MaxAcceleration = MAX_ACCELERATION,
                //    AvoidMargin = AVOID_MARGIN,
                //    MovementDebugColor = Color.cyan
                //};

                //priority.Movements.Add(avoidCharacter);
            }
        }

        var straightAhead = new DynamicStraightAhead
        {
            Character = character.KinematicData,
            MaxAcceleration = MAX_ACCELERATION,
            MovementDebugColor = Color.yellow
        };

        priority.Movements.Add(straightAhead);

        character.Movement = priority;
    }
    private void InitializeSecondaryCharacter(DynamicCharacter character, GameObject[] obstacles)
    {
        var priority = new PriorityMovement
        {
            Character = character.KinematicData
        };

        foreach (var obstacle in obstacles)
        {

            var avoidObstacleMovement = new DynamicAvoidObstacle(obstacle)
            {
                MaxAcceleration = MAX_ACCELERATION,
                avoidDistance = AVOID_MARGIN,
                lookAhead = MAX_LOOK_AHEAD,
                Character = this.RedCharacter.KinematicData,
                whiskersLookAhead = WHISKER_LOOK_AHEAD,
                MovementDebugColor = Color.magenta
            };
            priority.Movements.Add(avoidObstacleMovement);


        }

        foreach (var otherCharacter in this.Characters)
        {
            if (otherCharacter != character)
            {

                //TODO: add your avoidCharacter movement here
                var avoidCharacter = new DynamicAvoidCharacter(otherCharacter.KinematicData)
                {
                    Character = character.KinematicData,
                    MaxAcceleration = MAX_ACCELERATION,
                    AvoidMargin = AVOID_MARGIN,
                    MaximumTimeLookAhead = MAX_TIME_AHEAD,
                    MovementDebugColor = Color.cyan

                };

                priority.Movements.Add(avoidCharacter);
            }
        }

        var straightAhead = new DynamicStraightAhead
        {
            Character = character.KinematicData,
            MaxAcceleration = MAX_ACCELERATION,
            MovementDebugColor = Color.yellow
        };

        priority.Movements.Add(straightAhead);

        character.Movement = priority;
    }
    private void InitializeCharacter(DynamicCharacter character, GameObject[] obstacles)
    {
        var blended = new BlendedMovement
        {
            Character = character.KinematicData
        };

        foreach (var obstacle in obstacles)
        {
            DynamicAvoidObstacle avoidObstacleMovement = new DynamicAvoidObstacle(obstacle, true)
            {
                MaxAcceleration = MAX_ACCELERATION,
                AvoidMargin = AVOID_MARGIN,
                MaxLookAhead = MAX_LOOK_AHEAD,
                Character = character.KinematicData,
                MovementDebugColor = Color.magenta
            };
            blended.Movements.Add(new MovementWithWeight(avoidObstacleMovement, 15.0f));
        }

        DynamicCohesion cohesion = new DynamicCohesion(Characters)
        {
            MaxAcceleration = MAX_ACCELERATION,
            MaxSpeed = MAX_SPEED,
            MovementDebugColor = Color.cyan,
            Character = character.KinematicData,
            Radius = 15f,
            FanAngle = MathConstants.MATH_PI_4
        };
        blended.Movements.Add(new MovementWithWeight(cohesion, 8.0f));

        DynamicSeparation separation = new DynamicSeparation(Characters)
        {
            MaxAcceleration = MAX_ACCELERATION,
            MovementDebugColor = Color.green,
            Character = character.KinematicData,
            Radius = 10f,
            SeparationFactor = MAX_ACCELERATION * 1.3f
        };
        blended.Movements.Add(new MovementWithWeight(separation, 10.0f));

        DynamicFlockVelocityMatch velocityMatching = new DynamicFlockVelocityMatch(Characters)
        {
            MaxAcceleration = MAX_ACCELERATION,
            MovementDebugColor = Color.black,
            Character = character.KinematicData,
            Radius = 20f,
            FanAngle = MathConstants.MATH_PI_4
        };
        blended.Movements.Add(new MovementWithWeight(velocityMatching, 8.0f));

        DynamicGoToPosition goToPosition = new DynamicGoToPosition()
        {
            MaxAcceleration = MAX_ACCELERATION,
            MaxSpeed = MAX_SPEED,
            Character = character.KinematicData,
            MovementDebugColor = Color.blue,
            Radius = 10.0f
        };
        blended.Movements.Add(new MovementWithWeight(goToPosition, 8.0f));
        GoToPositionMovements.Add(goToPosition);

        if (soloMove)
        {
            if (useWander)
            {
                var wander = new DynamicWander
                {
                    MaxAcceleration = MAX_ACCELERATION,
                    MovementDebugColor = Color.yellow,
                    Character = character.KinematicData,
                    TurnAngle = MathConstants.MATH_PI_4 / 2,
                    WanderRadius = 2f,
                    WanderOffset = 3f
                };
                blended.Movements.Add(new MovementWithWeight(wander, 4.0f));
            }
            else
            {
                var straightAhead = new DynamicStraightAhead
                {
                    MaxAcceleration = MAX_ACCELERATION,
                    MovementDebugColor = Color.yellow,
                    Character = character.KinematicData
                };
                blended.Movements.Add(new MovementWithWeight(straightAhead, 4.0f));
            }
        }

        character.Movement = blended;
    }