home *** CD-ROM | disk | FTP | other *** search
/ Shocking The Web CD-ROM / SHOCK_CD.ISO / pc / tutorial / devglry / bigtop / shockwav / 27_pollu.dcr / 00109.ls < prev    next >
Encoding:
Text File  |  1996-04-10  |  1.7 KB  |  65 lines

  1. on doPause nbTicks
  2.   set stamp to the timer
  3.   repeat while the timer < (stamp + nbTicks)
  4.   end repeat
  5. end
  6.  
  7. on copyList sourceList
  8.   if not listp(sourceList) then
  9.     return []
  10.   end if
  11.   return value(string(sourceList))
  12. end
  13.  
  14. on updateFrameCounter
  15.   global curFrame, kSliderSpr, kFrameCounterSpr
  16.   set frameCounterSpr to 30
  17.   puppetSprite(frameCounterSpr, 1)
  18.   set the locH of sprite frameCounterSpr to the locH of sprite kSliderSpr - 14
  19.   put string(curFrame) into field "frameCounter"
  20. end
  21.  
  22. on updateShuttle
  23.   global curFrame, scoreData, kSliderSpr, kShuttleBarSpr, frameCounterSpr
  24.   set hOrg to the locH of sprite kShuttleBarSpr
  25.   set range to float(the width of sprite kShuttleBarSpr)
  26.   set nbFrames to count(scoreData)
  27.   if nbFrames < 1 then
  28.     set nbFrames to 1
  29.   end if
  30.   puppetSprite(kSliderSpr, 1)
  31.   set step to range / nbFrames
  32.   set dist to curFrame * step
  33.   if (nbFrames = 1) or (curFrame = 1) then
  34.     set dist to 0
  35.   end if
  36.   set sliderPos to hOrg + dist
  37.   set the locH of sprite kSliderSpr to sliderPos
  38.   set the locH of sprite frameCounterSpr to sliderPos - 14
  39.   put string(curFrame) into field "frameCounter"
  40. end
  41.  
  42. on formatField fieldName, font, size, style, color
  43.   if the text of field fieldName = EMPTY then
  44.     set the text of field fieldName to " "
  45.   end if
  46.   set the textFont of field fieldName to font
  47.   set the textSize of field fieldName to size
  48.   set the textStyle of field fieldName to style
  49.   set the foreColor of cast fieldName to color
  50. end
  51.  
  52. on preloadSounds
  53.   global loopData, soundData
  54.   repeat with curSound in soundData
  55.     if curSound then
  56.       preLoadCast(adjustCastNum(curSound))
  57.     end if
  58.   end repeat
  59.   repeat with curSound in loopData
  60.     if curSound then
  61.       preLoadCast(adjustCastNum(curSound))
  62.     end if
  63.   end repeat
  64. end
  65.