public TanksOnAHeightmapGame() { graphics = new GraphicsDeviceManager(this); device = GraphicsDevice; Content.RootDirectory = "Content"; music = Content.Load<Song>("Sound/windbell"); // Light Manager lightManager = new LightManager(); lightManager.AmbientLightColor = new Vector3(0.2f, 0.2f, 0.2f); Services.AddService(typeof(LightManager), lightManager); // Light 1 lightManager.Add("Light1", new PointLight(new Vector3(0, 1000.0f, 0), Vector3.One)); //tank = new Tank(this, Content, graphics); terrain = new TanksOnAHeightmap.GameBase.Shapes.Terrain(this, Content, graphics); //InputHelper inputHelper = new InputHelper(PlayerIndex.One); Services.AddService(typeof(InputHelper), inputHelper); // Create the chase camera camera = new ChaseCamera(this); // Set the camera offsets //camera.DesiredPositionOffset = new Vector3(0.0f, 600.0f, 800.0f);//150,150 //camera.LookAtOffset = new Vector3(0.0f, 80.0f, 0.0f);//80 camera.DesiredPositionOffset = new Vector3(0.0f, 45.0f, 20.0f);//150,150 camera.LookAtOffset = new Vector3(0.0f, 35.0f, -50.0f);//80 // Set camera perspective camera.NearPlaneDistance = 10.0f; camera.FarPlaneDistance = 4000.0f; this.Services.AddService(typeof(TanksOnAHeightmap.GameBase.Shapes.Terrain), terrain); this.Services.AddService(typeof(ChaseCamera), camera); rand = new Random(0); // Construct our particle system components. explosionParticles = new ExplosionParticleSystem(this, Content); ParticleSettings settings = new ParticleSettings(); this.Services.AddService(typeof(ExplosionParticleSystem), explosionParticles); explosionSmokeParticles = new ExplosionSmokeParticleSystem(this, Content); this.Services.AddService(typeof(ExplosionSmokeParticleSystem), explosionSmokeParticles); projectileTrailParticles = new ProjectileTrailParticleSystem(this, Content); //Trees trees = new Trees[NUMBER_OF_TREES]; for (int i = 0; i < trees.Length; i++) { trees[i] = new Trees(this, Content, graphics); //Components.Add(trees[i]); } explosionSmokeParticles.DrawOrder = 200; projectileTrailParticles.DrawOrder = 300; explosionParticles.DrawOrder = 400; terrain.DrawOrder = 102; //Trees this.graphics.PreferredBackBufferWidth = 1024; this.graphics.PreferredBackBufferHeight = 768; start(); }
/// <summary> /// Derived particle system classes should override this method /// and use it to initalize their tweakable settings. /// </summary> protected abstract void InitializeSettings(ParticleSettings settings);