
-----------------------------------
tupac
Sun Feb 19, 2006 9:03 am

pong game help
-----------------------------------
k, so i got the ball to travel in a path I directed it, but now i want it 2 bounce off the walls (imade somethin like that on turing, but it was a lot easier). so my code is: 
Private Sub Timer1_Timer()
Dim dx As Integer
Dim dy As Integer
Dim shape1Right As Integer
Dim shape1Down As Integer
shape1Right = Shape1.Left + Shape1.Width
shape1Down = Shape1.Top - Shape1.Height
dx = 5
dy = 5
If Shape1.Top >= 4800 Then
    dx = -dx
End If
If shape1Down = 7800 Then
    dy = -dy
End If
If Shape1.Left = 4800 and then make dx negative? shouldn't you be using shape1.Left or shape1Right if you want to change dx, and shape1.Left and shape1Down if you want to change dy.

-----------------------------------
tupac
Tue Feb 21, 2006 9:15 pm


-----------------------------------
i used that just cuz 4 some reason thats wat works... iduno, its weird...

-----------------------------------
cool dude
Wed Feb 22, 2006 6:41 pm


-----------------------------------
try something like this it should work. put the following code in your timer


   'sets the boundary for the maximum left the ball can go to
    If ball1.Left 