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 / slot.dcr / 00064_Digit.ls < prev    next >
Encoding:
Text File  |  2017-09-21  |  2.9 KB  |  117 lines

  1. on initdigit
  2.   global gheadlist, gbodylist, gleglist, gtimer, gslt, gspdh, gspdl, gtick
  3.   set gheadlist to [14, 15, 16, 17]
  4.   set gbodylist to [18, 19, 20, 21]
  5.   set gleglist to [22, 23, 24, 25]
  6.   set gtimer to [0, 0, 0]
  7.   set gslt to [0, 1, 0, 1, 0, 1]
  8.   set gspdh to [0, 0, 0]
  9.   set gspdl to [0, 0, 0]
  10.   set gtick to 60 / 8
  11.   set kakuritu to [4, 3, 2, 5]
  12.   setAt(gspdh, 1, 0)
  13.   setAt(gspdh, 3, 12)
  14.   setAt(gspdh, 2, 27)
  15.   setAt(gspdl, 1, 3)
  16.   setAt(gspdl, 3, 24)
  17.   setAt(gspdl, 2, 33)
  18.   set i to random(4)
  19.   set k to getAt(kakuritu, i)
  20.   if random(k) = 1 then
  21.     set j to i - 2
  22.     if j < 1 then
  23.       set j to 2 + i
  24.     end if
  25.     setAt(gslt, 2, j)
  26.     setAt(gslt, 6, j)
  27.     set j to i - 1
  28.     if j < 1 then
  29.       set j to 4
  30.     end if
  31.     setAt(gslt, 4, j)
  32.   else
  33.     set j to i - 2
  34.     if j < 1 then
  35.       set j to 2 + i
  36.     end if
  37.     setAt(gslt, 2, j)
  38.     setAt(gslt, 6, random(4))
  39.     setAt(gslt, 4, random(4))
  40.   end if
  41. end
  42.  
  43. on cleardigit
  44.   repeat with i = 1 to 6
  45.     set the puppet of sprite i to 0
  46.   end repeat
  47. end
  48.  
  49. on startdigit list
  50.   repeat with i = 1 to 3
  51.     set the puppet of sprite ((i * 2) - 1) to 1
  52.     set the castNum of sprite ((i * 2) - 1) to 13
  53.     set the puppet of sprite (i * 2) to 1
  54.     set the castNum of sprite (i * 2) to 13
  55.   end repeat
  56. end
  57.  
  58. on updatedigit i, list
  59.   global gspdh, gspdl, gslt, gstop
  60.   if gstop <> 0 then
  61.     if getAt(gspdh, i) <> 0 then
  62.       setAt(gspdh, i, getAt(gspdh, i) - 1)
  63.     else
  64.       if getAt(gspdl, i) <> 0 then
  65.         setAt(gspdl, i, getAt(gspdl, i) - 1)
  66.         set i to i * 2
  67.         set j to getAt(gslt, i - 1)
  68.         set k to getAt(gslt, i)
  69.         if j <> 1 then
  70.           if j = 0 then
  71.             setAt(gslt, i - 1, 3)
  72.             set j to 3
  73.             set k to k + 1
  74.             if k > 4 then
  75.               set k to 1
  76.             end if
  77.             setAt(gslt, i, k)
  78.           else
  79.             setAt(gslt, i - 1, j - 1)
  80.           end if
  81.           set l to k - 1
  82.           if l < 1 then
  83.             set l to 4
  84.           end if
  85.           set the castNum of sprite (i - 1) to getAt(list, l)
  86.           set the locH of sprite (i - 1) to 201 - ((4 - j) * 18)
  87.           set the castNum of sprite i to getAt(list, k)
  88.           set the locH of sprite i to 201 + (j * 18)
  89.           if getAt(gspdl, i / 2) = 0 then
  90.             setAt(gspdl, i / 2, j)
  91.           end if
  92.         else
  93.           setAt(gslt, i - 1, 0)
  94.           set the castNum of sprite (i - 1) to getAt(list, k)
  95.           set the locH of sprite (i - 1) to 201
  96.           set the castNum of sprite i to getAt(list, k)
  97.           set the locH of sprite i to 201
  98.           if getAt(gspdl, i / 2) = 0 then
  99.             puppetSound("8.├⌐~├çΓÇ╣├ç├ê")
  100.           end if
  101.         end if
  102.       end if
  103.     end if
  104.   end if
  105. end
  106.  
  107. on movedigit
  108.   global gheadlist, gbodylist, gleglist, gtick
  109.   if the timer > gtick then
  110.     startTimer()
  111.     updatedigit(1, gheadlist)
  112.     updatedigit(2, gbodylist)
  113.     updatedigit(3, gleglist)
  114.     updateStage()
  115.   end if
  116. end
  117.