home *** CD-ROM | disk | FTP | other *** search
/ Shocking The Web CD-ROM / SHOCK_CD.ISO / pc / tutorial / devglry / elementl / source / fun.dir / 00027.ls < prev    next >
Encoding:
Text File  |  1996-11-11  |  1.4 KB  |  67 lines

  1. on startMovie
  2.   global gIsDropper, gSuckedElement, gIsSucked, gDroppedElement, gAlreadyDroppedE
  3.   puppetSprite(9, 1)
  4.   set the visible of sprite 9 to 0
  5.   set gIsDropper to 0
  6.   set gSuckedElement to 0
  7.   set gIsSucked to 0
  8.   set gDroppedElement to 0
  9.   set gAlreadyDroppedE to 0
  10. end
  11.  
  12. on startSuck
  13.   global gIsDropper, gWhichElementCast
  14.   repeat while the mouseDown
  15.     repeat with w = 11 to 21
  16.       if rollOver(w) then
  17.         set onOne to 1
  18.         set gWhichElementCast to w
  19.       end if
  20.     end repeat
  21.     if onOne then
  22.       cursor([2])
  23.       set gIsDropper to 1
  24.     else
  25.       cursor([1])
  26.       set gIsDropper to 0
  27.     end if
  28.     set onOne to 0
  29.   end repeat
  30. end
  31.  
  32. on suckElement whichOne
  33.   global gSuckedElement, gIsSucked, gIsDropper
  34.   cursor([3])
  35.   set gIsDropper to 0
  36.   set gSuckedElement to whichOne
  37.   set gIsSucked to 1
  38. end
  39.  
  40. on unSuck
  41.   global gIsSucked, gIsDropper
  42.   set gIsDropper to 0
  43.   set gIsSucked to 0
  44. end
  45.  
  46. on dropElement
  47.   global gSuckedElement, gDroppedElement, gIsSucked, gAlreadyDroppedE
  48.   if gIsSucked then
  49.     if gSuckedElement = 11 then
  50.       if gDroppedElement = 0 then
  51.         set gAlreadyDroppedE to 1
  52.       else
  53.         go("Anim" & gDroppedElement)
  54.       end if
  55.     else
  56.       set gDroppedElement to gSuckedElement
  57.       if gAlreadyDroppedE = 1 then
  58.         go("Anim" & gDroppedElement)
  59.       else
  60.         nothing()
  61.       end if
  62.     end if
  63.     set gSuckedElement to 0
  64.     set gIsSucked to 0
  65.   end if
  66. end
  67.