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