home *** CD-ROM | disk | FTP | other *** search
/ Oz - The Magical Adventure / Adventure.iso / pc / dkdata / six.dxr / boat_78_setGame.ls < prev    next >
Encoding:
Text File  |  2000-06-01  |  1.4 KB  |  46 lines

  1. on setGame
  2.   global gDifficultyLevel, gFrameCounter, gGameSol, gGameState, gCurrentScreen
  3.   gFrameCounter = 0
  4.   case gDifficultyLevel of
  5.     1:
  6.       gGameSol = item random(6) of "111,222,333,444,555,666"
  7.     2:
  8.       theChoices = "123456"
  9.       theCombo = EMPTY
  10.       repeat with i = 1 to 2
  11.         myChoice = random(length(theChoices))
  12.         put char myChoice of theChoices into char i of theCombo
  13.         delete char myChoice of theChoices
  14.       end repeat
  15.       thirdPiece = char random(2) of theCombo
  16.       if random(10) > 5 then
  17.         put thirdPiece before theChoices
  18.       else
  19.         put thirdPiece after theChoices
  20.       end if
  21.       gGameSol = theCombo
  22.     otherwise:
  23.       theChoices = "123456"
  24.       theCombo = EMPTY
  25.       repeat with i = 1 to 3
  26.         myChoice = random(length(theChoices))
  27.         put char myChoice of theChoices into char i of theCombo
  28.         delete char myChoice of theChoices
  29.       end repeat
  30.       gGameSol = theCombo
  31.   end case
  32.   repeat with i = 1 to 3
  33.     sprite(34 - i).member = "6111_key_" & char i of gGameSol
  34.   end repeat
  35.   theCombination = EMPTY
  36.   repeat with i = 25 to 27
  37.     correctKey = value(char i - 24 of gGameSol)
  38.     keyVal = random(6)
  39.     repeat while (correctKey = keyVal) or (theCombination contains string(keyVal))
  40.       keyVal = random(6)
  41.     end repeat
  42.     put string(keyVal) after theChoices
  43.     sprite(i).member = "6111_lock_" & string(keyVal)
  44.   end repeat
  45. end
  46.