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 / 00044_ResQ.ls < prev    next >
Encoding:
Text File  |  2017-09-21  |  3.6 KB  |  138 lines

  1. property model, speed, psprite, pp, ph, pv, pb, pof1, pof2, pof3, phs, pend, phit
  2.  
  3. on birth me
  4.   global gspeed, gflg, gbarlist
  5.   if gflg = 0 then
  6.     if gspeed < 5 then
  7.       set i to random(4)
  8.     else
  9.       set i to random(5)
  10.       if i = 5 then
  11.         set gflg to 1
  12.       end if
  13.     end if
  14.   else
  15.     set i to random(4)
  16.   end if
  17.   set model to integer(word i of "5 9 5 9 13")
  18.   set pof1 to integer(word i of "-25 -25 -25 -25 -25")
  19.   set pof2 to integer(word i of "61 70 61 70 10")
  20.   set pof3 to integer(word i of "5 5 5 5 5")
  21.   set phs to integer(word i of "42 24 42 24 34")
  22.   set speed to integer(word random(gspeed + 1) of "5 10 12 15 17 3 22 25 27 5")
  23.   set psprite to 0
  24.   repeat while 1
  25.     set ii to random(6)
  26.     if getAt(gbarlist, ii) = 0 then
  27.       setAt(gbarlist, ii, 1)
  28.       set pp to ii
  29.       exit repeat
  30.     end if
  31.   end repeat
  32.   set ph to integer(word ii of "118 171 227 289 345 408")
  33.   set pb to integer(word ii of "73 115 145 134 117 84")
  34.   set pv to 0
  35.   set pend to 0
  36.   set phit to 0
  37.   return me
  38. end
  39.  
  40. on assignsprite me, aSprite
  41.   set psprite to aSprite
  42.   set the puppet of sprite psprite to 1
  43.   set the type of sprite psprite to 1
  44.   set the ink of sprite psprite to 8
  45.   set the castNum of sprite psprite to model
  46.   set the locV of sprite psprite to pv
  47.   set the locH of sprite psprite to ph + pof1
  48. end
  49.  
  50. on move me
  51.   global gspeed, gbarlist
  52.   if pend = 0 then
  53.     set i to the bottom of sprite psprite
  54.     if i < 280 then
  55.       if the locV of sprite psprite > pb then
  56.         set the castNum of sprite psprite to model + 1
  57.         set j to integer(word gspeed + 1 of "20 20 20 20 20 20 20 20 20 20")
  58.         set the locV of sprite psprite to the locV of sprite psprite + j
  59.         puppetSound("FALL2")
  60.         if i > 280 then
  61.           set the locV of sprite psprite to the locV of sprite psprite - (i - 280)
  62.         else
  63.           if phit = 0 then
  64.             if (i + 20) > 253 then
  65.               set the locV of sprite psprite to the locV of sprite psprite - (i - 233)
  66.               set phit to 1
  67.             end if
  68.           end if
  69.         end if
  70.       else
  71.         if speed >= 0 then
  72.           set speed to integer(word random(gspeed + 2) of "17 5 10 12 15 17 0 0 20 0 0")
  73.           set the locV of sprite psprite to the locV of sprite psprite + speed
  74.           if speed = 0 then
  75.             set speed to -random(gspeed * 7)
  76.           end if
  77.         else
  78.           set speed to speed + 1
  79.         end if
  80.       end if
  81.     else
  82.       set the castNum of sprite psprite to model + 3
  83.       set i to the bottom of sprite psprite - 280
  84.       set the locV of sprite psprite to the locV of sprite psprite - i
  85.       set phit to -1
  86.       set pend to the ticks + 120
  87.       puppetSound("OUT")
  88.     end if
  89.   else
  90.     if pend < the ticks then
  91.       set the puppet of sprite psprite to 0
  92.       setAt(gbarlist, pp, 0)
  93.       return 0
  94.     end if
  95.   end if
  96.   return 1
  97. end
  98.  
  99. on atari me, ch
  100.   global gbarlist
  101.   if pend = 0 then
  102.     if phit = 1 then
  103.       set phit to 2
  104.       set i to the left of sprite psprite + phs
  105.       if i > (ch - 40) then
  106.         if i < (ch + 40) then
  107.           set model to model + 2
  108.           set the castNum of sprite psprite to model
  109.           set i to the bottom of sprite psprite - 253
  110.           set the locV of sprite psprite to the locV of sprite psprite - i
  111.           set pend to the ticks + 20
  112.           puppetSound("OK")
  113.           setAt(gbarlist, pp, 0)
  114.           if model = the number of cast "Baba-safe" then
  115.             return 2
  116.           else
  117.             return 1
  118.           end if
  119.         end if
  120.       end if
  121.     end if
  122.   end if
  123.   if phit = -1 then
  124.     set phit to 0
  125.     return -1
  126.   else
  127.     return 0
  128.   end if
  129. end
  130.  
  131. on update me
  132.   return move(me)
  133. end
  134.  
  135. on check me, ch
  136.   return atari(me, ch)
  137. end
  138.