Alright, I'm trying to make a Breakout game, I have the ball moving and such, but I'm not sure of how to check if the ball has touched the brick, and if so, bounce it again and make that brick invisible.

Get it? Got it? Good.

now, I have this....

VB Code:
  1. Public Sub BlockSub(Ball As Shape, brick As Shape)
  2.  
  3. If Ball.Top - Ball.Height = brick.Top And Ball.Top = brick.Top - brick.Height Then
  4.     YSpeed = -YSpeed
  5.     Ball.Top = Ball.Top + YSpeed
  6.     Paddle.Visible = False
  7. End If
  8.  
  9. If Ball.Top = brick.Top + brick.Height Then
  10.     YSpeed = -YSpeed
  11.     Ball.Top = Ball.Top + YSpeed
  12.     Paddle.Visible = False
  13. End If
  14.  
  15. 'If Ball.Top + Ball.Height < Paddle.Top And Ball.Left >= Paddle.Left Then
  16. '    YSpeed = -YSpeed
  17. '    Ball.Top = Ball.Top + YSpeed
  18. 'Paddle.Visible = False
  19. 'End If
  20.  
  21. If Ball.Left + Ball.Width = brick.Left Then
  22.     XSpeed = -XSpeed
  23.     Ball.Left = Ball.Left + XSpeed
  24.     Paddle.Visible = False
  25. End If
  26.  
  27. If Ball.Left = brick.Left + brick.Width Then
  28.     XSpeed = -XSpeed
  29.     Ball.Left = Ball.Left + XSpeed
  30.     Paddle.Visible = False
  31. End If
  32.  
  33. End Sub

Any suggestions?