bool WhenStoppedDo(int i)
 {
     //Stop
     AIRacerScript.AIRacerList[i].CurrentMaxSpeed = 0;
     AIRacerScript.AIRacerList[i].SteeringForce   = AISteeringBehaviour.SeekOrFlee(AIRacerScript.AIRacerList[i].CurrentPosition, AIRacerScript.AIRacerList[i].DesiredPosition, AIRacerScript.AIRacerList[i].CurrentMaxSpeed / 1.3f, AIRacerScript.AIRacerList[i].CurrentDirection, false);
     return(true);
 }
Пример #2
0
    public bool Drive()
    {
        //If Rubberbanding Do X, for now do Y
        TheFearMachine.CurrentMaxSpeed = TheFearMachine.OriginalMaxSpeed;
        TheFearMachine.CurrentWaypoint = WaypointScript.CheckWaypointCollision(WaypointScript.WaypointList[TheFearMachine.CurrentWaypoint], false,
                                                                               TheFearMachine.CurrentPosition, TheFearMachine.CurrentWaypoint);
        //Drive Calculation
        TheFearMachine.DesiredPosition = WaypointScript.WaypointList[TheFearMachine.CurrentWaypoint].CentrePosition;
        TheFearMachine.SteeringForce   = AISteeringBehaviour.SeekOrFlee(TheFearMachine.CurrentPosition, TheFearMachine.DesiredPosition,
                                                                        TheFearMachine.CurrentMaxSpeed, TheFearMachine.CurrentDirection, true);

        return(true);
    }
    //If Status Do:

    bool WhenFearedDo(int i)
    {
        //Run from Target
        AIRacerScript.AIRacerList[i].SteeringForce = AISteeringBehaviour.SeekOrFlee(AIRacerScript.AIRacerList[i].CurrentPosition, FearMachineScript.TheFearMachine.CurrentPosition, AIRacerScript.AIRacerList[i].CurrentMaxSpeed / 1.3f, AIRacerScript.AIRacerList[i].CurrentDirection, false);
        return(true);
    }
Пример #4
0
 public void SeekWaypoint(int i, Waypoints Waypoint)
 {
     AIRacerScript.AIRacerList[i].DesiredPosition = Waypoint.CentrePosition;
     AIRacerScript.AIRacerList[i].SteeringForce   = AISteeringBehaviour.SeekOrFlee(AIRacerScript.AIRacerList[i].CurrentPosition, AIRacerScript.AIRacerList[i].DesiredPosition,
                                                                                   AIRacerScript.AIRacerList[i].CurrentMaxSpeed, AIRacerScript.AIRacerList[i].CurrentDirection, true);
 }