home *** CD-ROM | disk | FTP | other *** search
- global gSpriteWidth, gHalfWay
-
- on mouseDown
- set myH to the mouseH
- repeat while the stillDown
- set mouseOffsetH to the mouseH - myH
- if mouseOffsetH > 0 then
- set mouseOffsetH to sqrt(mouseOffsetH)
- else
- set mouseOffsetH to 0 - sqrt(abs(mouseOffsetH))
- end if
- if the right of sprite 1 < mouseOffsetH then
- set the locH of sprite 1 to gHalfWay - mouseOffsetH
- set the locH of sprite 2 to the locH of sprite 1 + gSpriteWidth
- else
- if the left of sprite 1 > mouseOffsetH then
- set the locH of sprite 1 to gHalfWay - gSpriteWidth - mouseOffsetH
- set the locH of sprite 2 to the locH of sprite 1 + gSpriteWidth
- else
- set the locH of sprite 1 to the locH of sprite 1 - mouseOffsetH
- set the locH of sprite 2 to the locH of sprite 2 - mouseOffsetH
- end if
- end if
- updateStage()
- end repeat
- end
-