Okay, so a while back I got an idea for this widget and it involves A LOT of special effects. Seemed like a daunting task to undertake but inspired by SirSmiley’s cool effects undertook it I did. In case I never actually complete this widget (considering how slow the process is) I just wanted to share the scripts for the effects as I complete them. Needless to say, credit goes to RomanDA for his very helpful tutorials.
The first one I’ve completed is the bouncing smiley (my desktop has been a zoo with smilies going every which way). It works best with any round image. I’ve broken down each action into sub procedures—it’s just easier for me to comprehend and manage that way.
Dim maxW
Dim minW
Sub Object_OnScriptEnter
'--Set maximum & minimum width
maxW= 100
minW= 40
'---Set object's position, width & height
object.left =500
object.top= 500
object.Width = 50
object.Height =50
Call jump
End Sub
Sub jump
object.SetTimer 1, 15
object.KillTimer 6
End Sub
Sub slowup
object.SetTimer 2, 15
object.KillTimer 1
End Sub
Sub slowdown
object.SetTimer 3, 15
object.KillTimer 2
End Sub
Sub fall
object.SetTimer 4, 15
object.KillTimer 3
End Sub
Sub squash
object.settimer 5, 15
object.KillTimer 4
End Sub
Sub stretch
object.settimer 6, 15
object.KillTimer 5
End Sub
'----JUMP-----
Sub object_ontimer1
object.Top = object.top -10
If object.top <= 350 Then Call slowup
End Sub
'----SLOW UP----
Sub object_ontimer2
object.top= object.top - 5
If object.top <= 300 Then Call slowdown
End Sub
'----SLOWDOWN----
Sub object_ontimer3
object.Top = object.top+5
If object.top => 315 Then Call fall
End Sub
'----FALL----
Sub object_ontimer4
object.Top= object.top + 10
If object.top => 500 Then Call squash
End Sub
'----SQUASH----
Sub object_ontimer5
If object.width < maxW Then
object.height = object.height-2
object.width= object.Width +5
object.top= object.top + 2
object.Left= object.Left -2
End If
If object.width => maxW Then Call stretch
End Sub
'----STRETCH----
Sub object_ontimer6
If object.width > minW Then
object.height = object.height+2
object.width= object.Width -5
object.top= object.top - 2
object.Left= object.Left +2
End If
If object.width <= minW Then Call jump
End Sub
Thanks for reading. More later. Please share any tips or comments.