home *** CD-ROM | disk | FTP | other *** search
- global pegData, grabbedPiece
-
- on mouseDown
- finalID = 0
- finalDist = 30
- repeat with wTest = 1 to count(pegData)
- testDist = findDistance(the mouseLoc, pegData[wTest][1])
- if testDist < finalDist then
- finalDist = testDist
- finalID = wTest
- end if
- end repeat
- grabbedPiece = finalID
- if grabbedPiece <> 0 then
- playSound("pickup", 4)
- end if
- end
-
- on mouseUp
- if grabbedPiece <> 0 then
- grabbedPiece = 0
- playSound("drop_anywhere", 5)
- end if
- end
-
- on mouseLeave
- if grabbedPiece <> 0 then
- grabbedPiece = 0
- playSound("drop_anywhere", 5)
- end if
- end
-