//Load Content Method ----------------------------------------------------------------------------------- protected override void LoadContent() { //Set the contentManger this.z_contentManager = new ContentManager(Services); // Create a new SpriteBatch, which can be used to draw textures. this.z_spriteBatch = new SpriteBatch(GraphicsDevice); //Set the viewPortRec this.z_viewportRec = new Rectangle(0, 0, z_graphics.GraphicsDevice.Viewport.Width, z_graphics.GraphicsDevice.Viewport.Height); //Add Objects to Game Services this.Services.AddService(typeof(SpriteBatch), z_spriteBatch); this.Services.AddService(typeof(ContentManager), z_contentManager); this.Services.AddService(typeof(GraphicsDeviceManager), z_graphics); this.Services.AddService(typeof(Rectangle), z_viewportRec); //Initialize the Ultimate Manager this.z_ultimateManager = new UltimateManager(this, this.z_contentManager); /* //Load the loadingManager this.z_loadingManager = new LoadingManager(Content.Load<Texture2D>("Screens\\LoadingStatic"), Content.Load<Texture2D>("Screens\\LogoScreen"), this.z_contentManager); //Load the gameStateManager this.z_gameStateManager = new GameStateManager(new TitleScreen(Content.Load<Texture2D>("Screens\\LogoScreen"), Content.Load<Texture2D>("Screens\\TitleOptions"), Content.Load<Texture2D>("Screens\\ArrowSelection"))); //Load the background Images this.z_backgroundImage1 = new ScrollingBackgroundManager(Content.Load<Texture2D>("Textures\\spaceBackground")); this.z_backgroundImage2 = new ScrollingBackgroundManager(Content.Load<Texture2D>("Textures\\spaceBackground")); //Set the positions for the background Images this.z_backgroundImage1.setPosition(new Vector2(0f, 0f)); this.z_backgroundImage2.setPosition(new Vector2(0f, 0f - this.z_viewportRec.Height)); //Turn the background Images alive this.z_backgroundImage1.setIsAlive(true); this.z_backgroundImage2.setIsAlive(true); //Set the starting position for player's ship this.z_startingPosition = new Vector2(this.z_viewportRec.Center.X, z_graphics.GraphicsDevice.Viewport.Height - 80); //Create the Player's ship image this.z_playerShip = new PlayerShip(Content.Load<Texture2D>("Images\\ship2"), this.z_startingPosition); //Set the player alive this.z_playerShip.setIsAlive(true); //Load Fonts this.z_timerFont = Content.Load<SpriteFont>("Fonts\\TimerFont"); this.z_livesFont = Content.Load<SpriteFont>("Fonts\\LivesFont"); //Load the Settings for the asteroidManager this.z_asteroidManager = new AsteroidManager(AsteroidManager.AsteroidManagerState.Heavy, this.z_viewportRec, this.z_contentManager, this.z_spriteBatch); //Load the Settings for the MissleManager this.z_missleManager = new MissleManager(this.z_viewportRec, this.z_contentManager, Content.Load<SoundEffect>("Audio\\SoundFX\\LaserPellet")); //Load the Settings for the EnemyManager this.z_enemyManager = new EnemyManager(this.z_contentManager, this.z_spriteBatch, this.z_viewportRec); **/ }
//Load Content Method ----------------------------------------------------------------------------------- protected override void LoadContent() { //Set the contentManger this.z_contentManager = new ContentManager(Services); // Create a new SpriteBatch, which can be used to draw textures. this.z_spriteBatch = new SpriteBatch(GraphicsDevice); //Set the viewPortRec this.z_viewportRec = new Rectangle(0, 0, z_graphics.GraphicsDevice.Viewport.Width, z_graphics.GraphicsDevice.Viewport.Height); //Add Objects to Game Services this.Services.AddService(typeof(SpriteBatch), z_spriteBatch); this.Services.AddService(typeof(ContentManager), z_contentManager); this.Services.AddService(typeof(GraphicsDeviceManager), z_graphics); this.Services.AddService(typeof(Rectangle), z_viewportRec); //Initialize the Ultimate Manager this.z_ultimateManager = new UltimateManager(this, this.z_contentManager); }