home *** CD-ROM | disk | FTP | other *** search
/ 321 GAMES / 321GAMES.iso / logic / runes / runes.exe / runes.DXR / 00001_STARTMOVIE.ls next >
Encoding:
Text File  |  1996-07-01  |  8.5 KB  |  351 lines

  1. on startMovie
  2.   global GRIDX, GRIDY, GRIDNUM, GRIDVAL, PUZZ, SOLUTIONFLAG, SOLCNT, SCOREBOARD, SCOREX, SCOREY, UPG, ALPH, CODEWORDP, FILELIST, REGTHERE, SCRTHERE, REGNAME, ALLSCORE, DUMMY
  3.   set ALLSCORE to EMPTY
  4.   set CODEWORDP to EMPTY
  5.   set UPG to 0
  6.   cursor(200)
  7.   if objectp(GWRITEOBJECT) then
  8.     GWRITEOBJECT(mdispose)
  9.   end if
  10.   if objectp(GREADOBJECT) then
  11.     GREADOBJECT(mdispose)
  12.   end if
  13.   set ALPH to "ABCDEFGHIJKLMNOPQURSTUVWXYZabcdefghijklmnopqurstuvwxyz" & RETURN
  14.   set the soundEnabled to 1
  15.   set the exitLock to 1
  16.   set REGTHERE to 0
  17.   set SCRTHERE to 0
  18.   set FILELIST to []
  19.   repeat with i = 1 to the maxinteger
  20.     set n to getNthFileNameInFolder(the pathName, i)
  21.     if n = EMPTY then
  22.       exit repeat
  23.     end if
  24.     append(FILELIST, n)
  25.   end repeat
  26.   repeat with n = 1 to count(FILELIST)
  27.     if "RUNES.SKR" = getAt(FILELIST, n) then
  28.       set SCRTHERE to 1
  29.     end if
  30.     if "RUNES.DAT" = getAt(FILELIST, n) then
  31.       set REGTHERE to 1
  32.     end if
  33.   end repeat
  34.   if REGTHERE = 0 then
  35.     if objectp(GWRITEOBJECT) then
  36.       GWRITEOBJECT(mdispose)
  37.     end if
  38.     set GWRITEOBJECT to FileIO(mnew, "WRITE", the pathName & "RUNES.DAT")
  39.     set DUMMY to "R6TEHKE9G9$8N*E#R3O8U8XZY" & RETURN
  40.     repeat with n = 1 to 5
  41.       GWRITEOBJECT(mWriteString, DUMMY)
  42.     end repeat
  43.     GWRITEOBJECT(mdispose)
  44.   end if
  45.   CHECKUPG()
  46.   if UPG = 0 then
  47.     set the text of field "OWNERNAME" to "UNREGISTERED  SHAREWARE  VERSION"
  48.   else
  49.     set the text of field "OWNERNAME" to REGNAME & "    " & "REGISTERED COPY"
  50.   end if
  51.   if SCRTHERE = 0 then
  52.     WRITENEWSCORES()
  53.   end if
  54.   READSCORES()
  55.   set SCOREX to []
  56.   set SCOREY to []
  57.   set M to 94 - 26
  58.   repeat with n = 1 to 26
  59.     set M to M + 26
  60.     append(SCOREY, M)
  61.     if n < 14 then
  62.       append(SCOREX, 180)
  63.     end if
  64.     if n > 13 then
  65.       append(SCOREX, 349)
  66.     end if
  67.     if n = 13 then
  68.       set M to 94 - 26
  69.     end if
  70.   end repeat
  71.   set SOLCNT to 0
  72.   set PUZZ to 0
  73.   set SOLUTIONFLAG to 0
  74.   set GRIDVAL to []
  75.   set GRIDNUM to []
  76.   set GRIDX to []
  77.   set GRIDY to []
  78.   set X to 65
  79.   set Y to 17
  80.   repeat with n = 1 to 12
  81.     set Y to Y + 32
  82.     set X to 65
  83.     repeat with NN = 1 to 14
  84.       set X to X + 32
  85.       append(GRIDX, X)
  86.       append(GRIDY, Y)
  87.       append(GRIDVAL, 0)
  88.     end repeat
  89.   end repeat
  90. end
  91.  
  92. on WRITENEWSCORES
  93.   global GWRITEOBJECT, ALLSCORE, SCOREFIL, SCOREP, CODEWORDP
  94.   set SCOREP to []
  95.   set SCOREFIL to "RUNES.SKR"
  96.   set ALLSCORE to EMPTY
  97.   repeat with n = 1 to 26
  98.     set ALLSCORE to ALLSCORE & "0"
  99.   end repeat
  100.   set CODEWORDP to ALLSCORE
  101.   CIPHER()
  102.   set ALLSCORE to CODEWORDP
  103.   if objectp(GWRITEOBJECT) then
  104.     GWRITEOBJECT(mdispose)
  105.   end if
  106.   set GWRITEOBJECT to FileIO(mnew, "WRITE", the pathName & SCOREFIL)
  107.   set ALLSCORE to ALLSCORE & RETURN & numToChar(10)
  108.   GWRITEOBJECT(mWriteString, ALLSCORE)
  109.   GWRITEOBJECT(mdispose)
  110.   DECIPHER()
  111.   set ALLSCORE to CODEWORDP
  112. end
  113.  
  114. on WALKRIGHT
  115.   global MAN, GRIDX, GRIDY, DT, MANH, MANC
  116.   set DT to 5
  117.   set MANX to getAt(GRIDX, MAN)
  118.   set MANY to getAt(GRIDY, MAN)
  119.   puppetSound("FOOTSTP.WAV")
  120.   repeat with n = 1 to 4
  121.     set the castNum of sprite 30 to 36 + n
  122.     set MANX to MANX + 8
  123.     set the locH of sprite 30 to MANX
  124.     updateStage()
  125.     COUNTTIME()
  126.   end repeat
  127.   set MAN to MAN + 1
  128.   set the castNum of sprite 30 to 37
  129.   set the locH of sprite 30 to getAt(GRIDX, MAN)
  130.   set the locV of sprite 30 to getAt(GRIDY, MAN)
  131.   updateStage()
  132. end
  133.  
  134. on WALKLEFT
  135.   global MAN, GRIDX, GRIDY, DT, MANH, MANC
  136.   set DT to 5
  137.   set MANX to getAt(GRIDX, MAN)
  138.   set MANY to getAt(GRIDY, MAN)
  139.   puppetSound("FOOTSTP.WAV")
  140.   repeat with n = 1 to 4
  141.     set the castNum of sprite 30 to 27 + n
  142.     set MANX to MANX - 8
  143.     set the locH of sprite 30 to MANX
  144.     updateStage()
  145.     COUNTTIME()
  146.   end repeat
  147.   set MAN to MAN - 1
  148.   set the castNum of sprite 30 to 28
  149.   set the locH of sprite 30 to getAt(GRIDX, MAN)
  150.   set the locV of sprite 30 to getAt(GRIDY, MAN)
  151.   updateStage()
  152. end
  153.  
  154. on MANFALL
  155.   global GRIDX, GRIDY, MAN, BDOWN, GRIDVAL, TMAN, DT, MANX, MANC, DR
  156.   set DT to 1
  157.   set TMAN to MAN
  158.   set BDOWN to 0
  159.   repeat while (getAt(GRIDVAL, TMAN + 14) = 0) or (getAt(GRIDVAL, TMAN + 14) = 15)
  160.     set TMAN to TMAN + 14
  161.     set BDOWN to BDOWN + 1
  162.     if TMAN > 154 then
  163.       exit repeat
  164.     end if
  165.   end repeat
  166.   repeat with n = 1 to BDOWN
  167.     ANIMATEORACLE()
  168.     set MANX to getAt(GRIDX, MAN)
  169.     set MANC to getAt(GRIDY, MAN)
  170.     repeat with NN = 1 to 4
  171.       set the castNum of sprite 30 to 48
  172.       set the locV of sprite 30 to MANC + 4
  173.       updateStage()
  174.       COUNTTIME()
  175.       set the castNum of sprite 30 to 47
  176.       set the locV of sprite 30 to MANC + 8
  177.       updateStage()
  178.       COUNTTIME()
  179.       set MANC to MANC + 8
  180.     end repeat
  181.     set MAN to MAN + 14
  182.   end repeat
  183.   puppetSound("MANDOWN.WAV")
  184.   updateStage()
  185. end
  186.  
  187. on JUMPRIGHT
  188.   global MAN, GRIDX, GRIDY, DT, MANX, MANC
  189.   set MANX to getAt(GRIDX, MAN)
  190.   set MANC to getAt(GRIDY, MAN)
  191.   set DT to 5
  192.   set the castNum of sprite 30 to 43
  193.   updateStage()
  194.   COUNTTIME()
  195.   set the castNum of sprite 30 to 44
  196.   updateStage()
  197.   COUNTTIME()
  198.   set the castNum of sprite 30 to 43
  199.   updateStage()
  200.   COUNTTIME()
  201.   set DT to 4
  202.   set the castNum of sprite 30 to 37
  203.   updateStage()
  204.   puppetSound("MANFLIP.WAV")
  205.   repeat with n = 1 to 4
  206.     set MANC to MANC - 8
  207.     set the locV of sprite 30 to MANC
  208.     if n = 2 then
  209.       set the castNum of sprite 30 to 55
  210.     end if
  211.     if n = 4 then
  212.       set the castNum of sprite 30 to 56
  213.     end if
  214.     updateStage()
  215.     COUNTTIME()
  216.   end repeat
  217.   set MAN to MAN - 14
  218.   set MANX to the locH of sprite 30
  219.   repeat with n = 1 to 4
  220.     if n = 1 then
  221.       set the castNum of sprite 30 to 56
  222.     end if
  223.     if n = 2 then
  224.       set the castNum of sprite 30 to 57
  225.     end if
  226.     if n = 3 then
  227.       set the castNum of sprite 30 to 58
  228.     end if
  229.     if n = 4 then
  230.       set the castNum of sprite 30 to 43
  231.     end if
  232.     set MANX to MANX + 8
  233.     set the locH of sprite 30 to MANX
  234.     updateStage()
  235.     COUNTTIME()
  236.   end repeat
  237.   set MAN to MAN + 1
  238.   set the castNum of sprite 30 to 37
  239. end
  240.  
  241. on JUMPLEFT
  242.   global MAN, GRIDX, GRIDY, DT, MANX, MANC
  243.   set MANX to getAt(GRIDX, MAN)
  244.   set MANC to getAt(GRIDY, MAN)
  245.   set DT to 5
  246.   set the castNum of sprite 30 to 34
  247.   updateStage()
  248.   COUNTTIME()
  249.   set the castNum of sprite 30 to 35
  250.   updateStage()
  251.   COUNTTIME()
  252.   set the castNum of sprite 30 to 34
  253.   updateStage()
  254.   COUNTTIME()
  255.   set DT to 4
  256.   set the castNum of sprite 30 to 28
  257.   updateStage()
  258.   puppetSound("MANFLIP.WAV")
  259.   repeat with n = 1 to 4
  260.     set MANC to MANC - 8
  261.     if n = 2 then
  262.       set the castNum of sprite 30 to 60
  263.     end if
  264.     if n = 4 then
  265.       set the castNum of sprite 30 to 61
  266.     end if
  267.     set the locV of sprite 30 to MANC
  268.     updateStage()
  269.     COUNTTIME()
  270.   end repeat
  271.   set MAN to MAN - 14
  272.   set MANX to the locH of sprite 30
  273.   repeat with n = 1 to 4
  274.     set the castNum of sprite 30 to 60 + n
  275.     if n = 4 then
  276.       set the castNum of sprite 30 to 34
  277.     end if
  278.     set MANX to MANX - 8
  279.     set the locH of sprite 30 to MANX
  280.     updateStage()
  281.     COUNTTIME()
  282.   end repeat
  283.   set MAN to MAN - 1
  284.   set the castNum of sprite 30 to 28
  285. end
  286.  
  287. on PICKUPBLOCKRGT
  288.   global GRIDVAL, HEAD, GRIDX, GRIDY, MAN, DT
  289.   set DT to 10
  290.   set the trails of sprite 11 to 0
  291.   set the locH of sprite 11 to getAt(GRIDX, MAN + 1)
  292.   set the locV of sprite 11 to getAt(GRIDY, MAN + 1)
  293.   set the castNum of sprite 30 to 51
  294.   updateStage()
  295.   COUNTTIME()
  296.   puppetSound("UGG.WAV")
  297.   setAt(GRIDVAL, MAN + 1, 0)
  298.   set the locH of sprite 11 to getAt(GRIDX, MAN - 14)
  299.   set the locV of sprite 11 to getAt(GRIDY, MAN - 14)
  300.   set the castNum of sprite 30 to 52
  301.   updateStage()
  302.   set HEAD to 1
  303.   COUNTTIME()
  304.   set DT to 5
  305.   set the castNum of sprite 30 to 51
  306.   updateStage()
  307.   COUNTTIME()
  308.   set the castNum of sprite 30 to 37
  309.   updateStage()
  310. end
  311.  
  312. on PICKUPBLOCKLFT
  313.   global GRIDVAL, HEAD, GRIDX, GRIDY, MAN, DT
  314.   set DT to 10
  315.   set the trails of sprite 11 to 0
  316.   set the locH of sprite 11 to getAt(GRIDX, MAN - 1)
  317.   set the locV of sprite 11 to getAt(GRIDY, MAN - 1)
  318.   set the castNum of sprite 30 to 49
  319.   updateStage()
  320.   COUNTTIME()
  321.   puppetSound("UGG.WAV")
  322.   setAt(GRIDVAL, MAN - 1, 0)
  323.   set the locH of sprite 11 to getAt(GRIDX, MAN - 14)
  324.   set the locV of sprite 11 to getAt(GRIDY, MAN - 14)
  325.   set the castNum of sprite 30 to 50
  326.   updateStage()
  327.   COUNTTIME()
  328.   set DT to 5
  329.   set the castNum of sprite 30 to 49
  330.   updateStage()
  331.   COUNTTIME()
  332.   set the castNum of sprite 30 to 28
  333.   updateStage()
  334.   set HEAD to 1
  335. end
  336.  
  337. on stopMovie
  338.   cursor(-1)
  339.   set the soundEnabled to 1
  340.   if objectp(GWRITEOBJECT) then
  341.     GWRITEOBJECT(mdispose)
  342.   end if
  343.   if objectp(GREADOBJECT) then
  344.     GREADOBJECT(mdispose)
  345.   end if
  346.   if objectp(printer) then
  347.     printer(mdispose)
  348.   end if
  349.   clearGlobals()
  350. end
  351.