public void CheckCollision(Ball ball) { if (alive && ball.Bounds.Intersects(location)) { alive = false; ball.Deflection(this); } }
/// <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); brickImage = Content.Load<Texture2D>("brick"); StartGame(); }