Skip to content

TREZAA #1011

@mohammed0556660-del

Description

@mohammed0556660-del

URL

using UnityEngine;

public class CarController : MonoBehaviour
{
public CarData car;
public Rigidbody rb;
public float steerForce = 8f;

void Start()
{
    rb = GetComponent<Rigidbody>();
    rb.mass = car.weight;
}

void FixedUpdate()
{
    float move = Input.GetAxis("Vertical");
    float steer = Input.GetAxis("Horizontal");

    rb.AddForce(transform.forward * move * car.acceleration * 100f);

    Vector3 drift = transform.right * steer * car.driftPower * 500f;
    rb.AddForce(drift);

    transform.Rotate(0, steer * steerForce, 0);
}

}

Current translation

public void SelectCar(int index)
{
FindObjectOfType().car =
FindObjectOfType().cars[index];
}

Suggested translation

using UnityEngine;

public class CarDatabase : MonoBehaviour
{
public CarData[] cars = new CarData[]
{
new CarData { carName="Caprice 96", maxSpeed=220f, acceleration=18f, driftPower=1.4f, weight=1800f, rearWheelDrive=true },
new CarData { carName="Crown Sedan", maxSpeed=210f, acceleration=16f, driftPower=1.3f, weight=1750f, rearWheelDrive=true },
new CarData { carName="Victoria LX", maxSpeed=215f, acceleration=17f, driftPower=1.35f, weight=1850f, rearWheelDrive=true },
new CarData { carName="Desert Pickup", maxSpeed=190f, acceleration=14f, driftPower=1.2f, weight=2000f, rearWheelDrive=true },
new CarData { carName="Sport Coupe", maxSpeed=260f, acceleration=22f, driftPower=1.6f, weight=1550f, rearWheelDrive=true },
new CarData { carName="Muscle 1970", maxSpeed=240f, acceleration=20f, driftPower=1.7f, weight=1700f, rearWheelDrive=true },
new CarData { carName="Patrol SUV", maxSpeed=200f, acceleration=15f, driftPower=1.1f, weight=2300f, rearWheelDrive=false },
new CarData { carName="Land Cruiser 70", maxSpeed=180f, acceleration=13f, driftPower=1.0f, weight=2400f, rearWheelDrive=false },
};
}

Corresponding English text

using UnityEngine;

[System.Serializable]
public class CarData
{
public string carName;
public float maxSpeed;
public float acceleration;
public float driftPower;
public float weight;
public bool rearWheelDrive;
}

Additional context

using UnityEngine;

public class CarController : MonoBehaviour
{
public CarData car;
public Rigidbody rb;
public float steerForce = 8f;

void Start()
{
    rb = GetComponent<Rigidbody>();
    rb.mass = car.weight;
}

void FixedUpdate()
{
    float move = Input.GetAxis("Vertical");
    float steer = Input.GetAxis("Horizontal");

    rb.AddForce(transform.forward * move * car.acceleration * 100f);

    if (rb.velocity.magnitude < car.maxSpeed)
        rb.AddForce(transform.forward * move * car.acceleration * 50f);

    // التفحيط

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-translationIssues related to translation problemsneeds-triageIssues that haven't been triaged yet

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions