//Constructor public AsteroidManager(AsteroidManagerState newState, Rectangle viewPort, ContentManager content, SpriteBatch spriteBatch) { //Define the current State this.z_currentState = newState; //Decide how many asteroids to put on screen this.adjustManagementSettings(); //Initialize other Variables this.z_viewPort = viewPort; this.z_minAsteroidSpeed = 0.1f; this.z_maxAsteroidSpeed = 1.5f; this.z_minStartingHeight = -100; this.z_maxStartingHeight = -200; this.z_minStartingWidth = 0; this.z_maxStartingWidth = (float)this.z_viewPort.Width; this.z_minRotationSpeed = 0.01f; this.z_maxRotationSpeed = 0.05f; this.z_minImage = 1; this.z_maxImage = 5; this.z_randomGenerator = new Random(); this.z_content = content; this.z_content.RootDirectory = "Content"; this.z_spriteBatch = spriteBatch; //Start Populating Asteroids after all variables have been initialized this.populateAsteroids(); }
//Mutator Methods public void setState(AsteroidManagerState newState) { this.z_currentState = newState; this.adjustManagementSettings(); this.populateAsteroids(); }