Exemplo n.º 1
0
 public void CheckCollision(Ball ball)
 {
     if (alive && ball.Bounds.Intersects(location))
     {
         alive = false;
         ball.Deflect(this);
     }
 }
Exemplo n.º 2
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);

            Texture2D tempTexture = Content.Load<Texture2D>("paddle");
            paddle = new Paddle(tempTexture, screenRectangle);

            tempTexture = Content.Load<Texture2D>("ball");
            ball = new Ball(tempTexture, screenRectangle);

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

            StartGame();
        }