Esempio n. 1
0
    //////////////////////////////////////////////////

    void Start()
    {
        body         = GetComponent <Rigidbody> ();
        physics      = GetComponent <car_physics> ();
        drive_engine = GetComponent <Drive_Engine> ();
        hover_engine = GetComponent <Hover_Engine> ();
        stabilizers  = GetComponent <Stabilizers> ();

        if (physics.runner_controls)
        {
            turning_physics = Turning_Physics.strafing;
        }
        else
        {
            turning_physics = Turning_Physics.angular_velocity;
        }

        // turning
        if (turning_physics == Turning_Physics.constant_local_rotation)
        {
            rotation_multiplier = 1.3f;
        }
        else if (turning_physics == Turning_Physics.constant_global_rotation)
        {
            rotation_multiplier = 1.3f;
        }
        else if (turning_physics == Turning_Physics.relative_torque)
        {
            rotation_multiplier = 500f;
        }
        else if (turning_physics == Turning_Physics.speed_based)
        {
            if (drive_engine.forward_physics == Drive_Engine.Forward_Physics.move_position)
            {
                rotation_multiplier = 2.5f;
            }
            if (drive_engine.forward_physics == Drive_Engine.Forward_Physics.set_velocity)
            {
                rotation_multiplier = .03f;
            }
            if (drive_engine.forward_physics == Drive_Engine.Forward_Physics.add_relative_force)
            {
                rotation_multiplier = .1f;
            }
        }
        else if (turning_physics == Turning_Physics.strafing)
        {
            horizontal_speed_max    = 25f;
            horizontal_acceleration = 3f;
        }
    }
Esempio n. 2
0
    //////////////////////////////////////////////////

    void Start()
    {
        body         = GetComponent <Rigidbody> ();
        physics      = GetComponent <car_physics> ();
        hover_engine = GetComponent <Hover_Engine> ();

        if (physics.runner_controls)
        {
            forward_physics = Forward_Physics.auto_set_velocity;
        }
        else
        {
            forward_physics = Forward_Physics.set_velocity;
        }

        if (forward_physics == Forward_Physics.move_position)
        {
            forward_speed_max    = .9f;
            forward_acceleration = .02f;
        }
        else if (forward_physics == Forward_Physics.set_velocity)
        {
            forward_speed_max    = 70f;
            forward_acceleration = 1f;
        }
        else if (forward_physics == Forward_Physics.auto_set_velocity)
        {
            forward_speed_max    = 70f;
            forward_acceleration = .1f;
        }
        else if (forward_physics == Forward_Physics.add_relative_force)
        {
            forward_speed_max    = 30f;
            forward_acceleration = .5f;
        }

        forward_speed = 0f;
        forward_speed_max_adjusted    = forward_speed_max;
        forward_acceleration_adjusted = forward_acceleration;
    }