home *** CD-ROM | disk | FTP | other *** search
/ Enter 2003: The Beautiful Scenery / enter-parhaat-2003.iso / files / frendz.exe / frendz.dcr / Scripts_22_b_InitGame.ls < prev    next >
Encoding:
Text File  |  2002-12-31  |  4.1 KB  |  82 lines

  1. global gComputerPlayer, gSpriteFirstSquare, gDifficulity, gLevel, gBoxButton, gDelayButton, gGameOn
  2.  
  3. on buildRandomStars theList
  4.   repeat with theLoc = 1 to 4
  5.     repeat while 1
  6.       case theLoc of
  7.         1:
  8.           n = random(16)
  9.         2:
  10.           n = 48 + random(16)
  11.         3:
  12.           n = random(2) + (8 * (random(8) - 1))
  13.         4:
  14.           n = random(2) + (8 * (random(8) - 1)) + 6
  15.       end case
  16.       if theList.getPos(n) = 0 then
  17.         exit repeat
  18.       end if
  19.     end repeat
  20.     theList[theLoc] = n
  21.   end repeat
  22. end
  23.  
  24. on prepareFrame me
  25.   gBoxButton = "Ok"
  26.   gDelayButton = -1
  27.   member("t_Score1").text = "2"
  28.   member("t_Score2").text = "2"
  29.   member("t_Level").text = string(gLevel)
  30.   gSpriteFirstSquare = 15
  31.   gComputerPlayer = [1, 0]
  32.   starsList = []
  33.   buildRandomStars(starsList)
  34.   goInitNewGame(8, 8, 10, 5, 45, 45, symbol(gDifficulity), gLevel, starsList)
  35.   moleInitScoreBubblesNewGame(98, 6)
  36.   goSetSleepTime(200)
  37.   goSetMinComputerTime(4 * 60)
  38.   goInitSpritesAndCasts(gSpriteFirstSquare, "red_popin0008", "blue_popin0008", "Square")
  39.   p1Base = member("red_popin0008").number
  40.   p2Base = member("blue_popin0008").number
  41.   transBase = member("fade0001").number
  42.   goAddAnimation(#NewPiece, [1, 2, 3, 4, 5, 6, 0], [2, 2, 2, 2, 2, 2, 2], 50)
  43.   goAddAnimation(#lookLeft, [14, 0], [120, 2], 20)
  44.   goAddAnimation(#lookUp, [11, 0], [120, 2], 20)
  45.   goAddAnimation(#lookRight, [12, 0], [120, 2], 20)
  46.   goAddAnimation(#lookDown, [13, 0], [120, 2], 20)
  47.   goAddAnimation(#blink1, [23, 0], [7, 7], 10)
  48.   goAddAnimation(#blink2, [23, 0, 23, 0], [7, 7, 7, 7], 10)
  49.   goAddAnimation(#blink3, [23, 0, 23, 0, 23, 0], [7, 7, 7, 7, 7, 7], 10)
  50.   goAddAnimation(#blink4, [23, 23, 0], [20, 20, 2], 10)
  51.   goAddAnimation(#blink5, [23, 23, 0], [20, 20, 2], 10)
  52.   goAddAnimation(#yawn, [8, 9, 10, 0], [4, 12, 90, 2], 20)
  53.   goAddAnimation(#sleep, [20, 21, 20, 21, 20, 21], [50, 50, 50, 50, 50, 50], 30, 1000000)
  54.   goAddAnimation(#wake, [15, 16, 15, 16, 15, 16, 0], [8, 8, 8, 8, 8, 8, 2], 30)
  55.   goAddAnimation(#watchMouseLeft, [14, 0], [15, 2], 15)
  56.   goAddAnimation(#watchMouseUp, [11, 0], [15, 2], 15)
  57.   goAddAnimation(#watchMouseRight, [12, 0], [15, 2], 15)
  58.   goAddAnimation(#watchMouseDown, [13, 0], [15, 2], 15)
  59.   td = 30
  60.   n = transBase - p1Base
  61.   n2 = p2Base - p1Base
  62.   goAddAnimation(#p1Transition1, [n2, n + 9, n + 8, n + 7, n + 6, n + 5, n + 4, n + 3, n + 2, n + 1, n + 0, 0], [10 + (0 * td), 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2], 50)
  63.   goAddAnimation(#p1Transition2, [n2, n + 9, n + 8, n + 7, n + 6, n + 5, n + 4, n + 3, n + 2, n + 1, n + 0, 0], [10 + (1 * td), 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2], 50)
  64.   goAddAnimation(#p1Transition3, [n2, n + 9, n + 8, n + 7, n + 6, n + 5, n + 4, n + 3, n + 2, n + 1, n + 0, 0], [10 + (2 * td), 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2], 50)
  65.   goAddAnimation(#p1Transition4, [n2, n + 9, n + 8, n + 7, n + 6, n + 5, n + 4, n + 3, n + 2, n + 1, n + 0, 0], [10 + (3 * td), 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2], 50)
  66.   n = transBase - p2Base
  67.   n2 = p1Base - p2Base
  68.   goAddAnimation(#p2Transition1, [n2, n + 0, n + 1, n + 2, n + 3, n + 4, n + 5, n + 6, n + 7, n + 8, n + 9, 0], [10 + (0 * td), 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2], 50)
  69.   goAddAnimation(#p2Transition2, [n2, n + 0, n + 1, n + 2, n + 3, n + 4, n + 5, n + 6, n + 7, n + 8, n + 9, 0], [10 + (1 * td), 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2], 50)
  70.   goAddAnimation(#p2Transition3, [n2, n + 0, n + 1, n + 2, n + 3, n + 4, n + 5, n + 6, n + 7, n + 8, n + 9, 0], [10 + (2 * td), 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2], 50)
  71.   goAddAnimation(#p2Transition4, [n2, n + 0, n + 1, n + 2, n + 3, n + 4, n + 5, n + 6, n + 7, n + 8, n + 9, 0], [10 + (3 * td), 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2], 50)
  72.   goAddAnimation(#EndCap1, [0, 24, 0, 24, 0, 24, 0], [0 * td, 2, 2, 4, 4, 6, 6, 2], 50)
  73.   goAddAnimation(#EndCap2, [0, 24, 0, 24, 0, 24, 0], [1 * td, 2, 2, 4, 4, 6, 6, 2], 50)
  74.   goAddAnimation(#EndCap3, [0, 24, 0, 24, 0, 24, 0], [2 * td, 2, 2, 4, 4, 6, 6, 2], 50)
  75.   goAddAnimation(#EndCap4, [0, 24, 0, 24, 0, 24, 0], [3 * td, 2, 2, 4, 4, 6, 6, 2], 50)
  76.   goAddAnimation(#newPiece1Star, [1, 2, 3, 4, 5, 6, 0], [2, 2, 2, 2, 2, 2, 2], 50)
  77.   goAddAnimation(#newPiece2Star, [25, 0, 25, 0, 25, 0], [12, 12, 12, 12, 12, 12], 50)
  78.   setGameState(#startNewGame)
  79.   goStartPlay()
  80.   gGameOn = 1
  81. end
  82.