home *** CD-ROM | disk | FTP | other *** search
/ Experience Hawaii / HAWAII.ISO / pc / credit.dir / 00017.ls < prev    next >
Encoding:
Text File  |  1996-04-12  |  2.3 KB  |  101 lines

  1. on initDelayTime
  2.   global startTime, permitgecko
  3.   set permitgecko to 1
  4.   set startTime to the ticks
  5. end
  6.  
  7. on checkDelayTime
  8.   global startTime, permitgecko
  9.   set delay to 3 * 60
  10.   if (permitgecko = 1) and (random(5) = 1) then
  11.     if random(2) = 1 then
  12.       runGeckoright()
  13.     else
  14.       runGeckoleft()
  15.     end if
  16.   else
  17.     set permitgecko to 0
  18.   end if
  19.   set currTime to the ticks
  20.   if currTime >= (startTime + delay) then
  21.     checksound()
  22.     puppetTransition(6, 2, 8)
  23.     go(the frame + 1)
  24.     puppetTransition(5, 2, 8)
  25.     initDelayTime()
  26.   else
  27.     go(the frame)
  28.   end if
  29. end
  30.  
  31. on rungecko
  32.   set whichway to random(2)
  33.   if whichway = 1 then
  34.     runGeckoright()
  35.   else
  36.     runGeckoleft()
  37.   end if
  38. end
  39.  
  40. on runGeckoright
  41.   global startX, startY, stopX, stopY, incX, incY, gecko, permitgecko
  42.   set gecko to 43
  43.   set R_geckolist to "241,242,243,244,245,246,247,248"
  44.   set startX to -30
  45.   set stopX to 640 + 30
  46.   set startY to random(300) + 20
  47.   if the machineType <> 256 then
  48.     set inc to (random(4) * 3) + 5
  49.   else
  50.     set inc to (random(4) * 1) + 2
  51.   end if
  52.   set stopY to startY
  53.   set geckoSprite to 43
  54.   set j to 0
  55.   repeat with n = 1 to (stopX - startX) / inc
  56.     if j < 7 then
  57.       set j to j + 1
  58.     else
  59.       set j to 1
  60.     end if
  61.     puppetSprite(gecko, 1)
  62.     set the castNum of sprite gecko to the value of item j of R_geckolist
  63.     set the locH of sprite gecko to n * inc
  64.     set the locV of sprite gecko to startY
  65.     updateStage()
  66.   end repeat
  67.   set permitgecko to 0
  68.   puppetSprite(gecko, 0)
  69. end
  70.  
  71. on runGeckoleft
  72.   global startX, startY, stopX, stopY, incX, incY, gecko, permitgecko
  73.   set gecko to 43
  74.   set L_geckolist to "253,254,255,256,257,258,259,260"
  75.   set stopX to -100
  76.   set startX to 640 + 30
  77.   set startY to random(400) + 20
  78.   if the machineType <> 256 then
  79.     set inc to (random(4) * 3) + 5
  80.   else
  81.     set inc to (random(4) * 1) + 2
  82.   end if
  83.   set stopY to startY
  84.   set geckoSprite to 43
  85.   set j to 0
  86.   repeat with n = 1 to abs((startX - stopX) / inc)
  87.     if j < 7 then
  88.       set j to j + 1
  89.     else
  90.       set j to 1
  91.     end if
  92.     puppetSprite(gecko, 1)
  93.     set the castNum of sprite gecko to the value of item j of L_geckolist
  94.     set the locH of sprite gecko to startX - (n * inc)
  95.     set the locV of sprite gecko to startY
  96.     updateStage()
  97.   end repeat
  98.   set permitgecko to 0
  99.   puppetSprite(gecko, 0)
  100. end
  101.