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

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