home *** CD-ROM | disk | FTP | other *** search
/ Shocking The Web CD-ROM / SHOCK_CD.ISO / mac / Chapter Tutorials / ch06.Media / 1bit graphics / dolphin / dolphin.dir / 00014.ls < prev    next >
Encoding:
Text File  |  1996-09-23  |  1.4 KB  |  52 lines

  1. on startMovie
  2.   global gDolphinNumList, VIZSPRITE
  3.   set gDolphinNumList to [0, random(5), random(5), random(5), random(5)]
  4.   set the puppet of sprite 2 to 0
  5.   set the puppet of sprite 3 to 0
  6.   set the puppet of sprite 4 to 0
  7.   set the puppet of sprite 5 to 0
  8.   set the puppet of sprite 8 to 0
  9.   updateStage()
  10.   set the puppet of sprite 2 to 1
  11.   set the puppet of sprite 3 to 1
  12.   set the puppet of sprite 4 to 1
  13.   set the puppet of sprite 5 to 1
  14.   set the puppet of sprite 8 to 1
  15.   dolphinInvis()
  16.   set VIZSPRITE to 3
  17. end
  18.  
  19. on mouseDown
  20.   global VIZSPRITE
  21.   set the visible of sprite VIZSPRITE to 1
  22.   set VIZSPRITE to VIZSPRITE + 1
  23.   if VIZSPRITE > 6 then
  24.     dolphinInvis()
  25.   end if
  26. end
  27.  
  28. on swim howfast, whichNum
  29.   global gDolphinNumList
  30.   set the locH of sprite whichNum to the locH of sprite whichNum + howfast
  31.   set dolphinNum to getAt(gDolphinNumList, whichNum)
  32.   set the castNum of sprite whichNum to the number of member ("dolphin " & dolphinNum)
  33.   if dolphinNum < 5 then
  34.     set dolphinNum to dolphinNum + 1
  35.   else
  36.     set dolphinNum to 1
  37.   end if
  38.   setAt(gDolphinNumList, whichNum, dolphinNum)
  39.   if the locH of sprite whichNum > (the stageRight + 45) then
  40.     set the locH of sprite whichNum to -40
  41.     setAt(gDolphinNumList, whichNum, random(5))
  42.   end if
  43. end
  44.  
  45. on dolphinInvis
  46.   global VIZSPRITE
  47.   set VIZSPRITE to 3
  48.   repeat with dolphinSprite = 3 to 5
  49.     set the visible of sprite dolphinSprite to 0
  50.   end repeat
  51. end
  52.