Exemplo n.º 1
0
 /// <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);
     ball.LoadContent(this.Content, "BallTexture", GraphicsDevice);
     player1.LoadContent(this.Content, "PaddleTexture", GraphicsDevice);
     player2.LoadContent(this.Content, "PaddleTexture", GraphicsDevice);
     // TODO: use this.Content to load your game content here
 }
Exemplo n.º 2
0
        protected override void LoadContent()
        {
            _spriteBatch = new SpriteBatch(_graphics.GraphicsDevice);

            // Load the game objects
            _ball.LoadContent(Content);
            _left.LoadContent(Content);
            _right.LoadContent(Content);

            // Load the messages
            _establishingConnectionMsg = Content.Load <Texture2D>("establishing-connection-msg.png");
            _waitingForGameStartMsg    = Content.Load <Texture2D>("waiting-for-game-start-msg.png");
            _gamveOverMsg = Content.Load <Texture2D>("game-over-msg.png");

            // Load sound effects
            _ballHitSFX = Content.Load <SoundEffect>("ball-hit.wav");
            _scoreSFX   = Content.Load <SoundEffect>("score.wav");
        }