public debris(List <Texture2D> t, LevelLibrary.Level l) { asteroids = new List <asteroid>(maxno); tex = new List <Texture2D>(); tex = t; leveldetails = l; }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); bg = new background(Content.Load <Texture2D>("stars"), Content.Load <Texture2D>("stars"), new Vector2(0, 0)); missilefire = Content.Load <SoundEffect>("Missile Fire"); shuttlesound = Content.Load <SoundEffect>("spaceship"); gunstart = Content.Load <SoundEffect>("gunstart"); gunstop = Content.Load <SoundEffect>("gunstop"); level = Content.Load <LevelLibrary.Level>("level1"); //load start and stop sounds gunsound = Content.Load <SoundEffect>("gunsound"); heatbar = Content.Load <Texture2D>("progress"); overheat = Content.Load <Texture2D>("overheated"); heatmeasure = new Rectangle(640, 430, 80, 20); heatpointer = Content.Load <Texture2D>("bar"); erths = new List <Texture2D>(); string h; string img = "earth/Capture"; for (int i = 120; i >= 0; i--) { h = img + i; erths.Add(Content.Load <Texture2D>(h)); } earths = new earth(erths); List <Texture2D> asts = new List <Texture2D>(); img = "asteroid/Asteroidframe"; for (int i = 0; i <= 24; i++) { h = img + i; asts.Add(Content.Load <Texture2D>(h)); } asteroids = new debris(asts, level); ship = new shuttle(Content.Load <Texture2D>("shuttle"), shuttlesound); List <Texture2D> particles = new List <Texture2D>(); particles.Add(Content.Load <Texture2D>("circle")); particles.Add(Content.Load <Texture2D>("circle")); particles.Add(Content.Load <Texture2D>("circle")); pe = new ParticleEngine(particles, new Vector2(0, 0), 10); me = new missileengine(Content.Load <Texture2D>("missile"), ship.position, ship.rotation, particles, missilefire); //create engine load texture gatling cannon //gatling cannon sound cannonengine = new missileengine(Content.Load <Texture2D>("20mm"), ship.position, ship.rotation, gunsound); velocity = Content.Load <SpriteFont>("velocity"); missilestatus = Content.Load <SpriteFont>("missilestats"); pause = Content.Load <SpriteFont>("pause"); // TODO: use this.Content to load your game content here }