home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
A Field Trip to the Sky (Demo)
/
Mac_Sunburst_AFieldTripToTheSky-Demo.iso
/
DIR
/
GAME.DIR
/
00111_Script_doDayLength
< prev
next >
Wrap
Text File
|
1996-03-27
|
2KB
|
76 lines
global gAttrList
global gDayLengthList, gDayLength
global gPower
on mouseDown
if( doButtonPress() ) then
if( gDayLength <> 0 OR gPower < 17 ) then
-- if they've already been here or have enough, tell em what for
set theDayLength to getProp(gAttrList,#daylength)
-- start the sound
doPlaySound( "DL" & string(theDayLength) )
else if gPower >= 17 then
-- else bark
doPlaySound( "Power3" )
end if
if the mouseDown then
put "double bah"
end if
if( gDayLength = 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( theDayLength <= 0 ) then
set endPoint to c + 3
else if ( theDayLength < 40 ) then
set endPoint to integer((c + lastC)/2)
else if( theDayLength >= 40 ) then
set endPoint to lastC - 2
end if
-- do the start of the animation
set gDayLengthList to []
repeat with i = c to lastC
add gDayLengthList, i
end repeat
-- sink back down to the correct point
repeat with i = (lastC-1) down to endPoint
add gDayLengthList, i
end repeat
-- and tack on the repeating animation
add gDayLengthList, endPoint-1
add gDayLengthList, endPoint-2
add gDayLengthList, endPoint-1
add gDayLengthList, endPoint
add gDayLengthList, endPoint+1
add gDayLengthList, endPoint+2
add gDayLengthList, endPoint
-- set up the pointer to that list
set gDayLength to 1
decreasePower(2)
updateStage
end if
doFlush()
end if
end