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); }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { RasterizerState rs = new RasterizerState(); rs.CullMode = CullMode.None; mGraphics.GraphicsDevice.RasterizerState = rs; PrimitiveRenderer primitiveRenderer = new PrimitiveRenderer(); primitiveRenderer.Setup(mGraphics.GraphicsDevice, kArenaWidth, kArenaHeight); mMTSCRenderer = new MTSCombatRenderer(primitiveRenderer); mMTSGame = new MTSCombatGame(2, kArenaWidth, kArenaHeight); SpawnVehicles(); base.Initialize(); }