home *** CD-ROM | disk | FTP | other *** search
/ What PC? 1996 August / WPCAUG96.ISO / makers / body / bodymain.dir / 00403_CheckSprite.ls < prev    next >
Encoding:
Text File  |  1996-06-12  |  1.6 KB  |  62 lines

  1. on bodyroll
  2.   global cursorcast, lastClick
  3.   set names to ["BARNARD", "MONTAGNIER", "EHRLICH", "FLEMING", "SANGER", "SPOCK", "BANTING", "STEPTOE", "CRICK", "PINCUS"]
  4.   set num to getPos(names, lastClick) + 3
  5.   set the visible of sprite 46 to 0
  6.   repeat with i = 4 to 13
  7.     set TempB to the castNum of sprite i
  8.     if the mouseCast = TempB then
  9.       if num <> i then
  10.         set temp to TempB + 1
  11.         if cursorcast <> temp then
  12.           ReleasCursor()
  13.           cursor(200)
  14.           set cursorcast to temp
  15.           set the castNum of sprite 46 to cursorcast
  16.         end if
  17.         set the visible of sprite 46 to 1
  18.         set the locH of sprite 46 to the mouseH
  19.         set the locV of sprite 46 to the mouseV
  20.         exit
  21.       end if
  22.     end if
  23.   end repeat
  24.   if rollOver(num) then
  25.     if cursorcast <> 0 then
  26.       put "enter to loop"
  27.       set cursorcast to 0
  28.       set the locH of sprite 46 to 1000
  29.       SetCursor()
  30.     end if
  31.     exit
  32.   end if
  33.   ReleasCursor()
  34.   cursor(-1)
  35.   set cursorcast to -1
  36.   set the locH of sprite 46 to 1000
  37. end
  38.  
  39. on clickBtn a, b
  40.   set name to a & ".down"
  41.   set the castNum of sprite b to the number of cast name
  42.   updateStage()
  43.   set STIcks to the ticks
  44.   repeat while (the ticks - STIcks) < 10
  45.     nothing()
  46.   end repeat
  47. end
  48.  
  49. on CheckSprite x, y, num
  50.   global SpritePlace
  51.   set x1 to getAt(SpritePlace, num)
  52.   set temp to count(x1)
  53.   repeat with j = 1 to temp
  54.     set x2 to getPropAt(x1, j)
  55.     if inside(point(x, y), rect(value(item 1 of x2), value(item 2 of x2), value(item 3 of x2), value(item 4 of x2))) then
  56.       return getAt(x1, j)
  57.       exit
  58.     end if
  59.   end repeat
  60.   return num + 3
  61. end
  62.