home *** CD-ROM | disk | FTP | other *** search
/ Internet 1996 World Exposition / park.org.s3.amazonaws.com.7z / park.org.s3.amazonaws.com / Japan / Panasonic- / funcity / tokyo / rescue.dcr / 00042_ÉnÉìÉhÉâ.ls < prev    next >
Encoding:
Text File  |  2017-09-21  |  1.3 KB  |  75 lines

  1. on createres
  2.   global greslist, gspeed
  3.   if gspeed < 4 then
  4.     if count(greslist) = 0 then
  5.       newresq()
  6.     end if
  7.   else
  8.     set j to (gspeed / 2) + 1
  9.     if j > 6 then
  10.       set j to 5
  11.     end if
  12.     set i to random(j) - count(greslist)
  13.     if i > 0 then
  14.       repeat with ii = 1 to i
  15.         newresq()
  16.       end repeat
  17.     end if
  18.   end if
  19. end
  20.  
  21. on moveres
  22.   global greslist, grestmp
  23.   set grestmp to []
  24.   repeat with i = 1 to count(greslist)
  25.     set res to getAt(greslist, i)
  26.     if update(res) then
  27.       add(grestmp, res)
  28.     end if
  29.   end repeat
  30.   set greslist to []
  31.   repeat with i = 1 to count(grestmp)
  32.     set res to getAt(grestmp, i)
  33.     add(greslist, res)
  34.   end repeat
  35. end
  36.  
  37. on checkres
  38.   global greslist, gcursorh
  39.   set k to 0
  40.   repeat with i = 1 to count(greslist)
  41.     set res to getAt(greslist, i)
  42.     set ii to check(res, gcursorh)
  43.     if ii = 1 then
  44.       dspten()
  45.       next repeat
  46.     end if
  47.     if ii = 2 then
  48.       dspten()
  49.       clear(1)
  50.       set k to 1
  51.       exit repeat
  52.       next repeat
  53.     end if
  54.     if ii = -1 then
  55.       dsplife(1)
  56.     end if
  57.   end repeat
  58.   return k
  59. end
  60.  
  61. on newresq
  62.   newres(birth(script "ResQ"))
  63. end
  64.  
  65. on newres res
  66.   global greslist, gscoretop, gscoreend
  67.   repeat with i = gscoretop to gscoreend
  68.     if the puppet of sprite i = 0 then
  69.       assignsprite(res, i)
  70.       add(greslist, res)
  71.       exit
  72.     end if
  73.   end repeat
  74. end
  75.