home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Boot Disc 5
/
boot-disc-1997-01.iso
/
media
/
demos.dir
/
00019_Script_CardSelectorClass
< prev
next >
Wrap
Text File
|
1996-11-05
|
4KB
|
104 lines
property spritelist,activesprite,startcastname,endcastname,numsprites
property basepos,startsprite,endsprite,delh,delv,oldbootpos,bootsprite
property numsteps
global cards
on new me,mystartcastname,myendcastname
set startcastname=mystartcastname
set endcastname=myendcastname
set numsteps=4
set startsprite=castspritea(startcastname)
set endsprite=castspritea(endcastname)
set startcast=the number of member mystartcastname
set endcast=the number of member endcastname
set spritelist=[:]
repeat with spritenum=startsprite to endsprite
addprop spritelist,spritenum,startcast+spritenum-startsprite
end repeat
set numsprites=count(spritelist)
set basepos=the loc of sprite startsprite
set cards=me
set delh=-4
set delv=6
set bootsprite=castspritea("bootback")
set oldbootpos=the loc of sprite bootsprite
layout me
return me
end
on layout me
repeat with index=numsprites-1 down to 0
set spritenum=getpropat(spritelist,index+1)
set curpos=basepos+index*point(delh,delv)
puppetsprite spritenum,true
set the loc of sprite spritenum to curpos
end repeat
updateStage
end
on swap me
global gspritenum
set activesprite=the clickon
set curcast=getprop(spritelist,activesprite)
set oldcast=getprop(spritelist,endsprite)
setprop spritelist,endsprite,curcast
setprop spritelist,activesprite,oldcast
set the membernum of sprite activesprite to oldcast
set the membernum of sprite endsprite to curcast
updateStage
end
on flip me
set endpos=the loc of sprite endsprite
set endcast=getprop(spritelist,endsprite)
set movedelta=(endpos-oldbootpos)*1.0/numsteps
set bootpos=oldbootpos
puppetsprite bootsprite,true
puppetsprite endsprite,true
set deltav=(the height of sprite endsprite/(numsteps-1))
set locH=the locH of sprite endsprite
set curpos=the locV of sprite endsprite
repeat with index=1 to integer(numsteps)
set curpos=curpos-deltav
set the locV of sprite endsprite to curpos
set the locH of sprite endsprite to locH
updateStage
end repeat
repeat with index=1 to numsteps
set the loch of sprite endsprite to (the loch of sprite endsprite)-(the locH of movedelta)
set the locV of sprite endsprite to (the locV of sprite endsprite)-(the locV of movedelta)
updateStage
end repeat
set the locH of sprite bootsprite to the locH of sprite endsprite
set the locV of sprite bootsprite to the locV of sprite endsprite
set the membernum of sprite bootsprite to the membernum of sprite endsprite
updateStage
set the visible of sprite bootsprite to true
set the visible of sprite endsprite to false
set the loc of sprite endsprite to endpos
updateStage
repeat with index=1 to numsteps
set the locV of sprite bootsprite to (the locV of sprite bootsprite)+deltaV
updateStage
end repeat
-- set the membernum of sprite endsprite-1 to (the membernum of sprite (endsprite))
set the visible of sprite bootsprite to false
set the visible of sprite endsprite to false
repeat with index=numsprites down to 2
set spritenum=getpropat(spritelist,index)
setprop spritelist,spritenum,getprop(spritelist,spritenum-1)
end repeat
setprop spritelist,startsprite,endcast
set the visible of sprite endsprite to true
repeat with index=numsprites down to 1
set spritenum=getpropat(spritelist,index)
set the membernum of sprite spritenum to getprop(spritelist,spritenum)
end repeat
updateStage
return (the name of member getlast(spritelist))
end