public void AddCar(RaceCar car) { if (car == null) { throw new ArgumentNullException(); } car.Body = m_physicsEngine.AddMobileBody(RaceCar.CAR_SHAPE, 3f, Vector2.Zero, "Metal"); m_cars.Add(car); _collisionEngine.AddMobileBody(car.Body); }
private void UpdateCar(RaceCar car) { float breaks = 0f; float gas = 0f; float steering = 0f; bool isReverse = false; if (car.CarControls != null) { breaks = car.CarControls.BreakPedalPosition; gas = car.CarControls.GasPedalPosition; steering = car.CarControls.SteeringPosition; isReverse = car.CarControls.IsInReverse; } }