home *** CD-ROM | disk | FTP | other *** search
/ 100 Plus Great Games 2 / 100PLUSV2.BIN / games / Pente.dxr / 00005_gameMovie.ls < prev    next >
Encoding:
Text File  |  2002-01-25  |  14.0 KB  |  324 lines

  1. global gGameBoard, gKounterH, gKounterV, gPosH, gPosV, gPuppeter, singleUndo, gPlaying, gSingleMove, gCompsTurn, gEKountH, gEKountV, gEMoves, gEWinX, gEWinY, gETrys, gEholdX, gEholdY, gELineH, gELineV, gELineHolder, gELineDirection, gEatmH, gEatmV, gEraseEnemy, gEraseFixH, gEraseFixV, gCapturedPlayer, gCapturedEnemy, gGo4WinV, gGo4WinH, gCheckPLines, gNuLine, gEBalls, gNuMapPosX, gNuMapPosY, gKountY, gKountX, gESaveLength, gLineDot, gAdd5Xs, gKount2, gFullBoard, gBlinker, gSpecial, gPlayerHasEaten, gEnemyHasEaten
  2.  
  3. on prepareMovie
  4.   gGameBoard = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]
  5.   cursor(member("blackBeadCursor"))
  6.   gPlayerHasEaten = 0
  7.   gEnemyHasEaten = 0
  8.   gKounterH = 1
  9.   gKounterV = 1
  10.   gPuppeter = 20
  11.   singleUndo = 1
  12.   gPlaying = 1
  13.   gELineHolder = [0, 0, 0, 0, 0]
  14.   gELineDirection = random(9)
  15.   gCompsTurn = 0
  16.   gEMoves = 0
  17.   gETrys = 0
  18.   gEKountV = 1
  19.   gEKountH = 1
  20.   gNuLine = 1
  21.   gEBalls = 1
  22.   gNuMapPosX = 0
  23.   gNuMapPosY = 0
  24.   gKountY = 1
  25.   gKountX = 1
  26.   gESaveLength = 0
  27.   gEatmX = 1
  28.   gEatmY = 1
  29.   gEraseEnemy = 20
  30.   gEraseFixH = 58
  31.   gEraseFixV = 8
  32.   gCapturedPlayer = 0
  33.   gCapturedEnemy = 0
  34.   gLineDot = 1
  35.   gEWinX = 1
  36.   gEWinY = 1
  37.   gAdd5Xs = 1
  38.   gFullBoard = 0
  39.   gBlinker = 0
  40.   startTimer()
  41. end
  42.  
  43. on enterFrame
  44.   if gPlaying = 1 then
  45.     PlayerMove()
  46.     PlayerWin()
  47.     EatBallsPlayer()
  48.     if gPlaying = 1 then
  49.       EnemyMove()
  50.       EnemyWin()
  51.       EatBallsEnemy()
  52.     end if
  53.     if ((the mouseH < 55) and (the mouseV < 378)) or (the mouseH > 477) then
  54.       cursor(member("noNoCursor"))
  55.     else
  56.       cursor(member("blackBeadCursor"))
  57.     end if
  58.   else
  59.     cursor(0)
  60.   end if
  61. end
  62.  
  63. on EnemyMove me
  64.   if gCompsTurn = 1 then
  65.     cursor(4)
  66.     gCompsTurn = 0
  67.     AI_Block()
  68.     if gGameBoard[gEKountV][gEKountH] = 0 then
  69.       gGameBoard[gEKountV][gEKountH] = 2
  70.       gEMoves = gEMoves + 1
  71.       gCompsTurn = 0
  72.       sprite(gPuppeter).puppet = 1
  73.       sprite(gPuppeter).member = "red bead"
  74.       sprite(gPuppeter).loc = point(58 + (gEKountH * 30), 9 + (gEKountV * 30))
  75.       repeat with gBlinker = 1 to 6
  76.         if (gBlinker mod 2) = 1 then
  77.           startTimer()
  78.           repeat while the timer < 6
  79.             sprite(gPuppeter).visible = 0
  80.             updateStage()
  81.           end repeat
  82.         end if
  83.         if (gBlinker mod 2) = 0 then
  84.           startTimer()
  85.           repeat while the timer < 6
  86.             sprite(gPuppeter).visible = 1
  87.             updateStage()
  88.           end repeat
  89.         end if
  90.       end repeat
  91.       puppetSound(2, "red piece")
  92.       sprite(gPuppeter).visible = 1
  93.       gPuppeter = gPuppeter + 1
  94.     else
  95.       AI_Random()
  96.       gGameBoard[gEKountV][gEKountH] = 2
  97.       gEMoves = gEMoves + 1
  98.       gCompsTurn = 0
  99.       sprite(gPuppeter).puppet = 1
  100.       sprite(gPuppeter).member = "red bead"
  101.       sprite(gPuppeter).loc = point(58 + (gEKountH * 30), 9 + (gEKountV * 30))
  102.       repeat with gBlinker = 1 to 6
  103.         if (gBlinker mod 2) = 1 then
  104.           startTimer()
  105.           repeat while the timer < 6
  106.             sprite(gPuppeter).visible = 0
  107.             updateStage()
  108.           end repeat
  109.         end if
  110.         if (gBlinker mod 2) = 0 then
  111.           startTimer()
  112.           repeat while the timer < 6
  113.             sprite(gPuppeter).visible = 1
  114.             updateStage()
  115.           end repeat
  116.         end if
  117.       end repeat
  118.       puppetSound(2, "red piece")
  119.       sprite(gPuppeter).visible = 1
  120.       gPuppeter = gPuppeter + 1
  121.     end if
  122.   end if
  123. end
  124.  
  125. on PlayerWin
  126.   if gCapturedPlayer >= 10 then
  127.     gPlaying = 0
  128.     startTimer()
  129.     go(15)
  130.   end if
  131.   repeat with gKounterV = 1 to 13
  132.     repeat with gKounterH = 1 to 13
  133.       if (gKounterH >= 2) and (gKounterH < 9) then
  134.         if (gGameBoard[gKounterV][gKounterH] = 1) and (gGameBoard[gKounterV][gKounterH + 1] = 1) and (gGameBoard[gKounterV][gKounterH + 2] = 1) and (gGameBoard[gKounterV][gKounterH + 3] = 1) and (gGameBoard[gKounterV][gKounterH + 4] = 1) then
  135.           repeat with gAdd5Xs = 0 to 4
  136.             sprite(286 + gAdd5Xs).puppet = 1
  137.             sprite(286 + gAdd5Xs).member = "black x red trim"
  138.             sprite(286 + gAdd5Xs).loc = point(58 + ((gKounterH + gAdd5Xs) * 30), 9 + (gKounterV * 30))
  139.           end repeat
  140.           gPlaying = 0
  141.           startTimer()
  142.           go(15)
  143.         end if
  144.       else
  145.         if gKounterH = 1 then
  146.           if (gGameBoard[gKounterV][gKounterH] = 1) and (gGameBoard[gKounterV][gKounterH + 1] = 1) and (gGameBoard[gKounterV][gKounterH + 2] = 1) and (gGameBoard[gKounterV][gKounterH + 3] = 1) and (gGameBoard[gKounterV][gKounterH + 4] = 1) then
  147.             repeat with gAdd5Xs = 0 to 4
  148.               sprite(286 + gAdd5Xs).puppet = 1
  149.               sprite(286 + gAdd5Xs).member = "black x red trim"
  150.               sprite(286 + gAdd5Xs).loc = point(58 + ((gKounterH + gAdd5Xs) * 30), 9 + (gKounterV * 30))
  151.             end repeat
  152.             gPlaying = 0
  153.             startTimer()
  154.             go(15)
  155.           end if
  156.         else
  157.           if gKounterH = 9 then
  158.             if (gGameBoard[gKounterV][gKounterH] = 1) and (gGameBoard[gKounterV][gKounterH + 1] = 1) and (gGameBoard[gKounterV][gKounterH + 2] = 1) and (gGameBoard[gKounterV][gKounterH + 3] = 1) and (gGameBoard[gKounterV][gKounterH + 4] = 1) then
  159.               repeat with gAdd5Xs = 0 to 4
  160.                 sprite(286 + gAdd5Xs).puppet = 1
  161.                 sprite(286 + gAdd5Xs).member = "black x red trim"
  162.                 sprite(286 + gAdd5Xs).loc = point(58 + ((gKounterH + gAdd5Xs) * 30), 9 + (gKounterV * 30))
  163.               end repeat
  164.               gPlaying = 0
  165.               startTimer()
  166.               go(15)
  167.             end if
  168.           end if
  169.         end if
  170.       end if
  171.       if (gKounterV >= 2) and (gKounterV < 9) then
  172.         if (gGameBoard[gKounterV][gKounterH] = 1) and (gGameBoard[gKounterV + 1][gKounterH] = 1) and (gGameBoard[gKounterV + 2][gKounterH] = 1) and (gGameBoard[gKounterV + 3][gKounterH] = 1) and (gGameBoard[gKounterV + 4][gKounterH] = 1) then
  173.           repeat with gAdd5Xs = 0 to 4
  174.             sprite(286 + gAdd5Xs).puppet = 1
  175.             sprite(286 + gAdd5Xs).member = "black x red trim"
  176.             sprite(286 + gAdd5Xs).loc = point(58 + (gKounterH * 30), 9 + ((gKounterV + gAdd5Xs) * 30))
  177.           end repeat
  178.           gPlaying = 0
  179.           startTimer()
  180.           go(15)
  181.         end if
  182.       else
  183.         if gKounterV = 1 then
  184.           if (gGameBoard[gKounterV][gKounterH] = 1) and (gGameBoard[gKounterV + 1][gKounterH] = 1) and (gGameBoard[gKounterV + 2][gKounterH] = 1) and (gGameBoard[gKounterV + 3][gKounterH] = 1) and (gGameBoard[gKounterV + 4][gKounterH] = 1) then
  185.             repeat with gAdd5Xs = 0 to 4
  186.               sprite(286 + gAdd5Xs).puppet = 1
  187.               sprite(286 + gAdd5Xs).member = "black x red trim"
  188.               sprite(286 + gAdd5Xs).loc = point(58 + (gKounterH * 30), 9 + ((gKounterV + gAdd5Xs) * 30))
  189.             end repeat
  190.             gPlaying = 0
  191.             startTimer()
  192.             go(15)
  193.           end if
  194.         else
  195.           if gKounterV = 9 then
  196.             if (gGameBoard[gKounterV][gKounterH] = 1) and (gGameBoard[gKounterV + 1][gKounterH] = 1) and (gGameBoard[gKounterV + 2][gKounterH] = 1) and (gGameBoard[gKounterV + 3][gKounterH] = 1) and (gGameBoard[gKounterV + 4][gKounterH] = 1) then
  197.               repeat with gAdd5Xs = 0 to 4
  198.                 sprite(286 + gAdd5Xs).puppet = 1
  199.                 sprite(286 + gAdd5Xs).member = "black x red trim"
  200.                 sprite(286 + gAdd5Xs).loc = point(58 + (gKounterH * 30), 9 + ((gKounterV + gAdd5Xs) * 30))
  201.               end repeat
  202.               gPlaying = 0
  203.               startTimer()
  204.               go(15)
  205.             end if
  206.           end if
  207.         end if
  208.       end if
  209.       if (gKounterV >= 2) and (gKounterV < 9) and ((gKounterH >= 2) and (gKounterH < 9)) then
  210.         if (gGameBoard[gKounterV][gKounterH] = 1) and (gGameBoard[gKounterV + 1][gKounterH + 1] = 1) and (gGameBoard[gKounterV + 2][gKounterH + 2] = 1) and (gGameBoard[gKounterV + 3][gKounterH + 3] = 1) and (gGameBoard[gKounterV + 4][gKounterH + 4] = 1) then
  211.           repeat with gAdd5Xs = 0 to 4
  212.             sprite(286 + gAdd5Xs).puppet = 1
  213.             sprite(286 + gAdd5Xs).member = "black x red trim"
  214.             sprite(286 + gAdd5Xs).loc = point(58 + ((gKounterH + gAdd5Xs) * 30), 9 + ((gKounterV + gAdd5Xs) * 30))
  215.           end repeat
  216.           gPlaying = 0
  217.           startTimer()
  218.           go(15)
  219.         end if
  220.       else
  221.         if (gKounterV = 1) and (gKounterH <= 9) then
  222.           if (gGameBoard[gKounterV][gKounterH] = 1) and (gGameBoard[gKounterV + 1][gKounterH + 1] = 1) and (gGameBoard[gKounterV + 2][gKounterH + 2] = 1) and (gGameBoard[gKounterV + 3][gKounterH + 3] = 1) and (gGameBoard[gKounterV + 4][gKounterH + 4] = 1) then
  223.             repeat with gAdd5Xs = 0 to 4
  224.               sprite(286 + gAdd5Xs).puppet = 1
  225.               sprite(286 + gAdd5Xs).member = "black x red trim"
  226.               sprite(286 + gAdd5Xs).loc = point(58 + ((gKounterH + gAdd5Xs) * 30), 9 + ((gKounterV + gAdd5Xs) * 30))
  227.             end repeat
  228.             gPlaying = 0
  229.             startTimer()
  230.             go(15)
  231.           end if
  232.         else
  233.           if (gKounterV = 9) and (gKounterH >= 2) and (gKounterH <= 9) then
  234.             if (gGameBoard[gKounterV][gKounterH] = 1) and (gGameBoard[gKounterV + 1][gKounterH + 1] = 1) and (gGameBoard[gKounterV + 2][gKounterH + 2] = 1) and (gGameBoard[gKounterV + 3][gKounterH + 3] = 1) and (gGameBoard[gKounterV + 4][gKounterH + 4] = 1) then
  235.               repeat with gAdd5Xs = 0 to 4
  236.                 sprite(286 + gAdd5Xs).puppet = 1
  237.                 sprite(286 + gAdd5Xs).member = "black x red trim"
  238.                 sprite(286 + gAdd5Xs).loc = point(58 + ((gKounterH + gAdd5Xs) * 30), 9 + ((gKounterV + gAdd5Xs) * 30))
  239.               end repeat
  240.               gPlaying = 0
  241.               startTimer()
  242.               go(15)
  243.             end if
  244.           else
  245.             if (gKounterV = 9) and (gKounterH = 1) then
  246.               if (gGameBoard[gKounterV][gKounterH] = 1) and (gGameBoard[gKounterV + 1][gKounterH + 1] = 1) and (gGameBoard[gKounterV + 2][gKounterH + 2] = 1) and (gGameBoard[gKounterV + 3][gKounterH + 3] = 1) and (gGameBoard[gKounterV + 4][gKounterH + 4] = 1) then
  247.                 repeat with gAdd5Xs = 0 to 4
  248.                   sprite(286 + gAdd5Xs).puppet = 1
  249.                   sprite(286 + gAdd5Xs).member = "black x red trim"
  250.                   sprite(286 + gAdd5Xs).loc = point(58 + ((gKounterH + gAdd5Xs) * 30), 9 + ((gKounterV + gAdd5Xs) * 30))
  251.                 end repeat
  252.                 gPlaying = 0
  253.                 startTimer()
  254.                 go(15)
  255.               end if
  256.             end if
  257.           end if
  258.         end if
  259.       end if
  260.       if (gKounterV > 5) and (gKounterV < 13) and ((gKounterH >= 2) and (gKounterH < 9)) then
  261.         if (gGameBoard[gKounterV][gKounterH] = 1) and (gGameBoard[gKounterV - 1][gKounterH + 1] = 1) and (gGameBoard[gKounterV - 2][gKounterH + 2] = 1) and (gGameBoard[gKounterV - 3][gKounterH + 3] = 1) and (gGameBoard[gKounterV - 4][gKounterH + 4] = 1) then
  262.           repeat with gAdd5Xs = 0 to 4
  263.             sprite(286 + gAdd5Xs).puppet = 1
  264.             sprite(286 + gAdd5Xs).member = "black x red trim"
  265.             sprite(286 + gAdd5Xs).loc = point(58 + ((gKounterH + gAdd5Xs) * 30), 9 + ((gKounterV - gAdd5Xs) * 30))
  266.           end repeat
  267.           gPlaying = 0
  268.           startTimer()
  269.           go(15)
  270.         end if
  271.       else
  272.         if (gKounterV = 13) and (gKounterH <= 9) then
  273.           if (gGameBoard[gKounterV][gKounterH] = 1) and (gGameBoard[gKounterV - 1][gKounterH + 1] = 1) and (gGameBoard[gKounterV - 2][gKounterH + 2] = 1) and (gGameBoard[gKounterV - 3][gKounterH + 3] = 1) and (gGameBoard[gKounterV - 4][gKounterH + 4] = 1) then
  274.             repeat with gAdd5Xs = 0 to 4
  275.               sprite(286 + gAdd5Xs).puppet = 1
  276.               sprite(286 + gAdd5Xs).member = "black x red trim"
  277.               sprite(286 + gAdd5Xs).loc = point(58 + ((gKounterH + gAdd5Xs) * 30), 9 + ((gKounterV - gAdd5Xs) * 30))
  278.             end repeat
  279.             gPlaying = 0
  280.             startTimer()
  281.             go(15)
  282.           end if
  283.         else
  284.           if (gKounterV = 5) and (gKounterH = 1) then
  285.             if (gGameBoard[gKounterV][gKounterH] = 1) and (gGameBoard[gKounterV - 1][gKounterH + 1] = 1) and (gGameBoard[gKounterV - 2][gKounterH + 2] = 1) and (gGameBoard[gKounterV - 3][gKounterH + 3] = 1) and (gGameBoard[gKounterV - 4][gKounterH + 4] = 1) then
  286.               repeat with gAdd5Xs = 0 to 4
  287.                 sprite(286 + gAdd5Xs).puppet = 1
  288.                 sprite(286 + gAdd5Xs).member = "black x red trim"
  289.                 sprite(286 + gAdd5Xs).loc = point(58 + ((gKounterH + gAdd5Xs) * 30), 9 + ((gKounterV - gAdd5Xs) * 30))
  290.               end repeat
  291.               gPlaying = 0
  292.               startTimer()
  293.               go(15)
  294.             end if
  295.           else
  296.             if (gKounterV = 5) and (gKounterH >= 2) and (gKounterH <= 9) then
  297.               if (gGameBoard[gKounterV][gKounterH] = 1) and (gGameBoard[gKounterV - 1][gKounterH + 1] = 1) and (gGameBoard[gKounterV - 2][gKounterH + 2] = 1) and (gGameBoard[gKounterV - 3][gKounterH + 3] = 1) and (gGameBoard[gKounterV - 4][gKounterH + 4] = 1) then
  298.                 repeat with gAdd5Xs = 0 to 4
  299.                   sprite(286 + gAdd5Xs).puppet = 1
  300.                   sprite(286 + gAdd5Xs).member = "black x red trim"
  301.                   sprite(286 + gAdd5Xs).loc = point(58 + ((gKounterH + gAdd5Xs) * 30), 9 + ((gKounterV - gAdd5Xs) * 30))
  302.                 end repeat
  303.                 gPlaying = 0
  304.                 startTimer()
  305.                 go(15)
  306.               end if
  307.             end if
  308.           end if
  309.         end if
  310.       end if
  311.       if gGameBoard[gKounterV][gKounterH] <> 0 then
  312.         gFullBoard = gFullBoard + 1
  313.       end if
  314.       if gFullBoard >= 169 then
  315.         gFullBoard = 0
  316.         gPlaying = 0
  317.         go(34)
  318.         put "3"
  319.       end if
  320.     end repeat
  321.   end repeat
  322.   gFullBoard = 0
  323. end
  324.