Esempio n. 1
0
 public Opponent(string carFile, Vector3 position, float direction, CpuDriver driver)
 {
     if (driver == null) driver = new CpuDriver();
     Driver = driver;
     Vehicle = new Vehicle(GameVars.BasePath + @"cars\" + carFile, Driver);
     if (driver is CopDriver)
     {
         Vehicle.Chassis.Actor.GlobalPosition = position;
         Vehicle.Chassis.Actor.GlobalOrientation *= Matrix.CreateRotationY(MathHelper.ToRadians(90));
     }
     else
     {
         Vehicle.PlaceOnGrid(position, direction);
     }
     SetupVehicle();
 }
Esempio n. 2
0
 public Opponent(string carFile, Vector3 position, float direction, CpuDriver driver)
 {
     if (driver == null)
     {
         driver = new CpuDriver();
     }
     Driver  = driver;
     Vehicle = new Vehicle(GameVars.BasePath + @"cars\" + carFile, Driver);
     if (driver is CopDriver)
     {
         Vehicle.Chassis.Actor.GlobalPosition     = position;
         Vehicle.Chassis.Actor.GlobalOrientation *= Matrix.CreateRotationY(MathHelper.ToRadians(90));
     }
     else
     {
         Vehicle.PlaceOnGrid(position, direction);
     }
     SetupVehicle();
 }