Search Tools Links Login

Earthquake Shake Effect


Visual Basic 6, or VB Classic

Makes a form shaking.
<< Earthquake Shake Effect >>

Original Author: jBaron

Assumptions

My First Code In PSC

Code

'Put this code in a module
'*********************** Author ****************************
'Earthquake Shake Effect
'Author: jBaron
'E-mail Address: jbaron@freemail.gr
'Website: www.hackedemonia.tk
'Dated on: 05-09-2005
'For any problems,suggestions please E-mail me.
'***********************************************************
' In a command button place the above code:
'example: << Call Shake(Form1,1,1000,100) >>
'
'             a)  b) c) d)
'a) Here we call a form.
'
'b) We give the State: 1 for shaking Horizontally,2 for shaking Vertically
'  3 for shaking both Horizonally and Vertically.
'
'c) We give a number to say for How Long the form will be shaking.
'
'd) We give a number to say How Big the effect will be.
'Warning:
' # If You give a large number (Howlong) it wiil take a long time
'  for the effect to pass out and may conflict your program.
' # Same happens with (Howbig).
Public Function Shake(Aform As Form, State As Integer, Howlong As Long, Howbig As Long)
Dim i As Long
If State = 1 Then
  '--> Shakes Form LeftRight...
  For i = 0 To Howlong
    Aform.Left = Aform.Left + Howbig
    Aform.Left = Aform.Left - Howbig
  Next i
End If
If State = 2 Then
  '--> Shakes Form UpDown...
  For i = 0 To Howlong
    Aform.Top = Aform.Top + Howbig
    Aform.Top = Aform.Top - Howbig
  Next i
End If
If State = 3 Then
  '--> Shakes Form UpDown and LeftRight...
  For i = 0 To Howlong
    Aform.Left = Aform.Left + Howbig
    Aform.Left = Aform.Left - Howbig

    Aform.Top = Aform.Top + Howbig
    Aform.Top = Aform.Top - Howbig
  Next i
End If
End Function

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 169 times

Categories

Visual Basic 6

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.