/// <summary> /// Construct a new World object, holding the game simulation. /// </summary> public World(Vector2 dimensions) { this.dimensions = dimensions; safeDimensions = new Rectangle( (int)(dimensions.X * 0.05f), (int)(dimensions.Y * 0.05f), (int)(dimensions.X * 0.90f), (int)(dimensions.Y * 0.90f)); // create the players ships = new Ship[4]; ships[0] = new Ship(this, PlayerIndex.One); ships[1] = new Ship(this, PlayerIndex.Two); ships[2] = new Ship(this, PlayerIndex.Three); ships[3] = new Ship(this, PlayerIndex.Four); // create the starfield starfield = new Starfield(starCount, new Rectangle( starfieldBuffer * -1, starfieldBuffer * -1, (int)this.dimensions.X + starfieldBuffer * 2, (int)this.dimensions.Y + starfieldBuffer * 2)); // create a new list of actors actors = new CollectCollection <Actor>(this); // create a new list of particle systems particleSystems = new CollectCollection <ParticleSystem>(this); }
/// <summary> /// Construct a new World object, holding the game simulation. /// </summary> public World(Vector2 dimensions) { this.dimensions = dimensions; safeDimensions = new Rectangle( (int)(dimensions.X * 0.05f), (int)(dimensions.Y * 0.05f), (int)(dimensions.X * 0.90f), (int)(dimensions.Y * 0.90f)); // create the players ships = new Ship[4]; ships[0] = new Ship(this, PlayerIndex.One); ships[1] = new Ship(this, PlayerIndex.Two); ships[2] = new Ship(this, PlayerIndex.Three); ships[3] = new Ship(this, PlayerIndex.Four); // create the starfield starfield = new Starfield(starCount, new Rectangle( starfieldBuffer * -1, starfieldBuffer * -1, (int)this.dimensions.X + starfieldBuffer * 2, (int)this.dimensions.Y + starfieldBuffer * 2)); // create a new list of actors actors = new CollectCollection<Actor>(this); // create a new list of particle systems particleSystems = new CollectCollection<ParticleSystem>(this); }