VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



This bounces an object in a form. Can be used for many games.

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


Rate This bounces an object in a form. Can be used for many games.



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
 

Download this snippet    Add to My Saved Code

This bounces an object in a form. Can be used for many games. Comments

No comments have been posted about This bounces an object in a form. Can be used for many games.. Why not be the first to post a comment about This bounces an object in a form. Can be used for many games..

Post your comment

Subject:
Message:
0/1000 characters