/// <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); spriteSheetLoader = new SpriteSheetLoader(Content); //startMenuBackgroundSprite = Content.Load<Texture2D>("StartScreen.png"); //var s = File.OpenRead("Content/StartScreen.png"); startMenuBackgroundSprite = PngLoader.Load(this.GraphicsDevice, "Content/StartScreen.png"); backgroundAnimation.LoadBackGround(this.GraphicsDevice, Content); backgroundAnimation.spriteBatch = new SpriteBatch(GraphicsDevice); HealthBar.healthBarTexture = PngLoader.Load(this.GraphicsDevice, "Content/HealthBar.png"); EnemyClass.enemyTexture = PngLoader.Load(this.GraphicsDevice, "Content/EnemyShip.png"); player.InitializeAndLoadPlayer(this.GraphicsDevice, Content, initialPlayerPosition, new SpriteBatch(GraphicsDevice)); player.spriteBatch = new SpriteBatch(GraphicsDevice); playerShotHandler = new PlayerShotHandler(this.GraphicsDevice, Content, GraphicsDevice); playerShotHandler.playerShootingSpawnCounter = 0; playerShotHandler.shootingStartPositionCorrection = new Vector2((player.playerTexture.Width * player.shipScale.X) / 2, 0); arialFont = Content.Load <SpriteFont>("Arial"); arialFont28 = Content.Load <SpriteFont>("Arial_28"); TextureManager.enemySpriteSheet = spriteSheetLoader.Load(this.GraphicsDevice, "EnemyDeathAnimationTexture.png"); startButtonSprite = PngLoader.Load(this.GraphicsDevice, "Content/StartButton.png"); upgradeButtonSprite = PngLoader.Load(this.GraphicsDevice, "Content/UpgradesButton.png"); exitButtonSprite = PngLoader.Load(this.GraphicsDevice, "Content/ExitButton.png"); startMenuScreen.LoadStartMenu(GraphicsDevice, Content, screenWidth, startMenuBackgroundSprite, startButtonSprite, upgradeButtonSprite, exitButtonSprite); startMenuScreen.spriteBatch = new SpriteBatch(GraphicsDevice); gameStateWatcher.SubscribeStartButton(startMenuScreen.startButton); gameStateWatcher.SubscribeUpgradeButton(startMenuScreen.upgradeButton); gameStateWatcher.SubscribeExitButton(startMenuScreen.exitButton); gameOverScreen.LoadGameOverScreen(GraphicsDevice, Content, screenWidth, upgradeButtonSprite, exitButtonSprite); gameStateWatcher.SubscribeUpgradeButton(gameOverScreen.upgradeButton); gameStateWatcher.SubscribeExitButton(gameOverScreen.exitButton); }