by Gyro (Beginners) (1 Submission)
Category: Games
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Tue 13th March 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)
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
'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