Pong

How do create a program that has a ball bouncing around the screen and a small  square shape in the middle of the screen.  How do you program to have a ball bouncing off the shape and the sides of the form?
jkro34Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
tenetjaxConnect With a Mentor Commented:
to make the ball bounce off of the left side of the center block write the following:

if (shape1.left + shape1.width > label1.left)  and
  (shape1.left + shape1.width < label1.left + 200)  and
  (shape1.top > label1.top) and
  (shape1.top+shape1.height<label1.top +label1.height)
then your code goes here

the 4 arguements can be adjusted to work for the 4 sides of label1 (the block) and shape1 (the ball)
0
 
jkro34Author Commented:
I am just beginning to program in VB. This question is like pong and  probably is pretty easy.
0
 
RipsCommented:
Cheater!
0
All Courses

From novice to tech pro — start learning today.