home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
A Field Trip to the Sky (Demo)
/
Mac_Sunburst_AFieldTripToTheSky-Demo.iso
/
DIR
/
GAME.DIR
/
00110_Script_doDistance
< prev
next >
Wrap
Text File
|
1996-03-27
|
2KB
|
68 lines
global gAttrList
global gDistList, gDist
global gPower
on mouseDown
if( doButtonPress() ) then
if( gDist <> 0 OR gPower < 17 ) then
-- if they've already been here or have enough, tell em what for
set theDist to getProp(gAttrList,#distance)
doPlaySound( "DS" & string(theDist) )
else if gPower >= 17 then
-- else bark
doPlaySound( "Power3" )
end if
if( gDist = 0 AND gPower < 17) then
-- set up the sprite to be animated, cast range from 47 to 55
set c to the number of cast "needle lo"
set lastC to the number of cast "needle hi"
if( theDist <= 0 ) then
set endPoint to c + 3
else if ( theDist = 100 ) then
set endPoint to integer((c + lastC)/2)
else if( theDist >= 1000 ) then
set endPoint to lastC - 2
end if
-- do the start of the animation
set gDistList to []
repeat with i = c to lastC
add gDistList, i
end repeat
-- sink back down to the correct point
repeat with i = (lastC-1) down to endPoint
add gDistList, i
end repeat
-- and tack on the repeating animation
add gDistList, endPoint-1
add gDistList, endPoint-2
add gDistList, endPoint-1
add gDistList, endPoint
add gDistList, endPoint+1
add gDistList, endPoint+2
add gDistList, endPoint
-- set up the pointer to that list
set gDist to 1
decreasePower(2)
updateStage
end if
doFlush()
end if
end