Beispiel #1
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

            brickTexture = Content.Load <Texture2D>("brick");

            player.LoadContent(Content);

            bricks = new Brick[10, 10];
            for (int y = 0; y < 10; y++)
            {
                for (int x = 0; x < 10; x++)
                {
                    brickRect    = new Rectangle(x * brickTexture.Width, y * brickTexture.Height, brickTexture.Width, brickTexture.Height);
                    bricks[x, y] = new Brick(new Vector2(x * brickTexture.Width, y * brickTexture.Height));
                }
            }
            foreach (Brick brick in bricks)
            {
                brick.LoadContent(Content);
            }
            ball.LoadContent(Content);
        }
Beispiel #2
0
 public void LoadContent(ContentManager content)
 {
     _level.LoadContent(content);
     _player.LoadContent(content);
 }