AutoHide Sprite
Its not much, but if anyone wants it, then here you go
` AutoHide
`
` By Michael Mihalyfi
` [email protected]
Global AutoHide
SN = 1
IN = 1
Box 0,0,100,100
Get Image IN,0,0,100,100
Sprite SN,0,0,IN
Cls
Do
If MouseClick() = 1 Then AutoHide("Right",SN,5,20)
Sync
Loop
Function AutoHide(Direction$,SN,WaiTime,Gap)
IN = Sprite Image(SN)
If Direction$ = "Left"
If AutoHide = 1
For V = 1 to Sprite Width(SN) - Gap
Wait WaiTime
Sprite SN,Sprite X(SN) - 1,Sprite Y(SN),IN
Next V
AutoHide = 0
ExitFunction
EndIf
If AutoHide = 0
For V = 1 to Sprite Width(SN) - Gap
Wait WaiTime
Sprite SN,Sprite X(SN) + 1,Sprite Y(SN),IN
Next V
AutoHide = 1
ExitFunction
EndIf
EndIf
If Direction$ = "Right"
If AutoHide = 1
For V = 1 to Sprite Width(SN) - Gap
Wait WaiTime
Sprite SN,Sprite X(SN) + 1,Sprite Y(SN),IN
Next V
AutoHide = 0
ExitFunction
EndIf
If AutoHide = 0
For V = 1 to Sprite Width(SN) - Gap
Wait WaiTime
Sprite SN,Sprite X(SN) - 1,Sprite Y(SN),IN
Next V
AutoHide = 1
ExitFunction
EndIf
EndIf
If Direction$ = "Up"
If AutoHide = 1
For V = 1 to Sprite Width(SN) - Gap
Wait WaiTime
Sprite SN,Sprite X(SN),Sprite Y(SN) - 1,IN
Next V
AutoHide = 0
ExitFunction
EndIf
If AutoHide = 0
For V = 1 to Sprite Width(SN) - Gap
Wait WaiTime
Sprite SN,Sprite X(SN),Sprite Y(SN) + 1,IN
Next V
AutoHide = 1
ExitFunction
EndIf
EndIf
If Direction$ = "Down"
If AutoHide = 1
For V = 1 to Sprite Width(SN) - Gap
Wait WaiTime
Sprite SN,Sprite X(SN),Sprite Y(SN) + 1,IN
Next V
AutoHide = 0
ExitFunction
EndIf
If AutoHide = 0
For V = 1 to Sprite Width(SN) - Gap
Wait WaiTime
Sprite SN,Sprite X(SN),Sprite Y(SN) - 1,IN
Next V
AutoHide = 1
ExitFunction
EndIf
EndIf
EndFunction