by haxor2000 (1 Submission)
Category: Games
Compatability: Visual Basic 4.0 (32-bit)
Difficulty: Unknown Difficulty
Originally Published: Fri 21st January 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)
This bounces an object in a form. Can be used for many games.
API Declarations
dim DeltaX, DeltaY as Integer
img1.move img1.Left + DeltaY, img1.Top + DeltaX
If img1.Left < ScaleLeft Then DeltaY = 100
If img1.Left + img1.Width > ScaleWidth + ScaleLeft Then
DeltaY = -100
End If
If img1.Top < ScaleTop Then DeltaX = 100
If img1.Top + img1.Height > ScaleHeight + ScaleTop Then
DeltaX = -100
End If
'Make Sure Timer1.Enabled = True
Private Sub cmd1_Click()
Timer1.Interval = 50
DeltaX = 100
DeltaY = 100