home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
A Field Trip to the Sky (Demo)
/
Mac_Sunburst_AFieldTripToTheSky-Demo.iso
/
DIR
/
GAME.DIR
/
00114_Script_doWeight
< prev
next >
Wrap
Text File
|
1996-03-27
|
2KB
|
69 lines
global gAttrList
global gWeightList, gWeight
global gPower
on mouseDown
if( doButtonPress() ) then
set theWeight to getProp(gAttrList,#gravity)
if( gWeight <> 0 OR gPower < 17 ) then
-- if they've already been here or have enough, tell em what for
doPlaySound( "WE" & string(theWeight+1) )
else if gPower >= 17 then
-- else bark
doPlaySound( "Power3" )
end if
if( gWeight = 0 AND gPower < 17) then
-- set up the list to be animated
-- 293 is start, 293 is same, 271 is less, 314 is more
set theStart to 240 + the Top of sprite 11
if( theWeight = -1 ) then
set theEndPoint to 228 + the Top of sprite 11
else if ( theWeight = 1 ) then
set theEndPoint to 261 + the Top of sprite 11
else
set theEndPoint to theStart
end if
-- set up the start of the animation
set gWeightList to []
-- add the first part
set i to 0
set m to theWeight * 2
put m
repeat while abs(i) < abs(theEndPoint - theStart)
add gWeightList, theStart + i
set i = i + m
end repeat
-- finally, add in the flutter
add gWeightList, theEndPoint - 2
add gWeightList, theEndPoint - 1
add gWeightList, theEndPoint
add gWeightList, theEndPoint + 2
add gWeightList, theEndPoint + 1
add gWeightList, theEndPoint
-- set up the pointer to that list
set gWeight to 1
decreasePower(2)
updateStage
end if
doFlush()
end if
end