Ejemplo n.º 1
0
 public VehiclePrototype(float size, VehicleDrive drive, VehicleControlsConfig controlConfig, GunMount guns)
 {
     VehicleSize   = size;
     VehicleDrive  = drive;
     ControlConfig = controlConfig;
     Guns          = guns;
 }
Ejemplo n.º 2
0
 private GunMount MakeGunMount(float size)
 {
     Vector2[] gunArray = new Vector2[]
     {
         size *MTSCombatRenderer.GetRelativeGunMountLocation(0),
         size *MTSCombatRenderer.GetRelativeGunMountLocation(1),
         size *MTSCombatRenderer.GetRelativeGunMountLocation(2)
     };
     const float barrelReloadTime = 1.2f;
     const float gunSpeed         = 700f;
     GunMount    gunMount         = new GunMount(new GunData(barrelReloadTime, gunSpeed), gunArray);
     return(gunMount);
 }
Ejemplo n.º 3
0
        private void SpawnVehicles()
        {
            const float vehicleSize = 5.5f;
            GunMount    gunMount    = MakeGunMount(vehicleSize);

            AsteroidsControlData data           = new AsteroidsControlData(190f, 175f, 6.25f, 7.25f);
            VehicleDrive         asteroidsDrive = AsteroidsControlsFactory.MakeDrive(data);

            VehiclePrototype asteroidsPrototype = new VehiclePrototype(vehicleSize, asteroidsDrive, AsteroidsControlsFactory.StandardConfig, gunMount);

            Vector2           position         = new Vector2(kArenaWidth / 4, kArenaHeight / 4);
            Orientation2      orientation      = new Orientation2(MathHelper.Pi);
            DynamicTransform2 initialPlacement = new DynamicTransform2(position, orientation);

            SpawnVehicle(asteroidsPrototype, initialPlacement); //TODO: This returns the assigned ID. Use it to setup proper control pipeline

            position         = new Vector2(3 * kArenaWidth / 4, 3 * kArenaHeight / 4);
            orientation      = new Orientation2(0f);
            initialPlacement = new DynamicTransform2(position, orientation);
            SpawnVehicle(asteroidsPrototype, initialPlacement);
        }