SteveCRM
Dec 1st, 1999, 07:28 AM
I am trying to make a pong type game to test my skills, and this won't work. It is screwed up in the part where it hits the paddle.
'Bounces Puck Around Screen
Image1.Move Image1.Left + DeltaX, Image1.Top + DeltaY
If Image1.Left < ScaleLeft Then DeltaX = 100
If Image1.Left + Image1.Width > ScaleWidth + ScaleWidth Then
DeltaX = -100
End If
If Image1.Top < ScaleTop Then DeltaY = 100
If Image1.Top + Image1.Height > ScaleHeight + ScaleTop Then
DeltaY = -100
End If
'Bounces Off Of Paddle
If Image1.Left < Label1.Left Then DeltaX = 100
If Image1.Left + Image1.Width > Label1.Width + Label1.Width Then
DeltaX = -100
End If
If Image1.Top < Label1.Top Then DeltaY = 100
If Image1.Top + Image1.Height > Label1.Height + Label1.Top Then
DeltaY = -100
End If
Steve
'Bounces Puck Around Screen
Image1.Move Image1.Left + DeltaX, Image1.Top + DeltaY
If Image1.Left < ScaleLeft Then DeltaX = 100
If Image1.Left + Image1.Width > ScaleWidth + ScaleWidth Then
DeltaX = -100
End If
If Image1.Top < ScaleTop Then DeltaY = 100
If Image1.Top + Image1.Height > ScaleHeight + ScaleTop Then
DeltaY = -100
End If
'Bounces Off Of Paddle
If Image1.Left < Label1.Left Then DeltaX = 100
If Image1.Left + Image1.Width > Label1.Width + Label1.Width Then
DeltaX = -100
End If
If Image1.Top < Label1.Top Then DeltaY = 100
If Image1.Top + Image1.Height > Label1.Height + Label1.Top Then
DeltaY = -100
End If
Steve