Makes a ball have collision
Makes a ball have collision
API Declarations
'Put the Circle in the Square
'Name the Square "Bounds"
'Name the Circle "Ball"
'Now add a timer
Dim MovRL, MovUD
Rate Makes a ball have collision
(1(1 Vote))
'Put the Circle in the Square
'Name the Square "Bounds"
'Name the Circle "Ball"
'Now add a timer
Private Sub Form_Load()
MovUD = 100
MovRL = 100
End Sub
Private Sub Timer1_Timer()
If Ball.Left <= Bounds.Left Then
MovRL = 100
ElseIf Ball.Top <= Bounds.Top Then
MovUD = 100
ElseIf Ball.Left + Ball.Width >= Bounds.Left + Bounds.Width Then
MovRL = -100
ElseIf Ball.Top + Ball.Height >= Bounds.Top + Bounds.Height Then
MovUD = -100
End If
Ball.Left = Ball.Left + MovRL
Ball.Top = Ball.Top + MovUD
End Sub
Makes a ball have collision Comments
No comments yet — be the first to post one!
Post a Comment