/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); switch (brickColor) { case BrickColor.RED: brickSprite = contentManager.Load <Texture2D>(@"Content\brick_red"); break; case BrickColor.BLUE: brickSprite = contentManager.Load <Texture2D>(@"Content\brick_blue"); break; case BrickColor.YELLOW: brickSprite = contentManager.Load <Texture2D>(@"Content\brick_yellow"); break; case BrickColor.GREEN: brickSprite = contentManager.Load <Texture2D>(@"Content\brick_green"); break; } brickColorArray = Collisions.TextureTo2DArray(brickSprite); widthScale = ((float)Game1.graphics.PreferredBackBufferWidth / (float)numOfBricks) / (float)brickSprite.Width; scaleVector = new Vector2((widthScale * 0.8f), 0.2f); int yPos = (BRICK_GAP * (rowNumber + 1) + ((int)Height * rowNumber)); Y = yPos; }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); paddleSprite = contentManager.Load <Texture2D>(@"Content\paddle_red"); paddleColorArray = Collisions.TextureTo2DArray(paddleSprite); }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); // Load the texture if it exists ballSprite = contentManager.Load <Texture2D>(@"Content\ball_black"); ballColorArray = Collisions.TextureTo2DArray(ballSprite); }