home *** CD-ROM | disk | FTP | other *** search
/ 100 Plus Great Games 2 / 100PLUSV2.BIN / games / GoMoku.dxr / 00005_gameMovie.ls < prev    next >
Encoding:
Text File  |  2002-01-25  |  15.0 KB  |  309 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]]
  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.   startTimer()
  33. end
  34.  
  35. on enterFrame
  36.   if gPlaying = 1 then
  37.     PlayerMove()
  38.     PlayerWin()
  39.     if gPlaying = 1 then
  40.       EnemyMove()
  41.       EnemyWin()
  42.     end if
  43.     if ((the mouseH < 55) and (the mouseV < 378)) or (the mouseH > 477) then
  44.       cursor(member("noNoCursor"))
  45.     else
  46.       cursor(member("blackBeadCursor"))
  47.     end if
  48.   else
  49.     cursor(0)
  50.   end if
  51. end
  52.  
  53. on EnemyMove me
  54.   if gCompsTurn = 1 then
  55.     cursor(4)
  56.     gCompsTurn = 0
  57.     AI_Block(me)
  58.     if gGameBoard[gEKountV][gEKountH] = 0 then
  59.       gGameBoard[gEKountV][gEKountH] = 2
  60.       gEMoves = gEMoves + 1
  61.       gCompsTurn = 0
  62.       sprite(gEPuppet).puppet = 1
  63.       sprite(gEPuppet).member = "red bead"
  64.       sprite(gEPuppet).loc = point(55 + (gEKountH * 30), 7 + (gEKountV * 30))
  65.       repeat with gBlinker = 1 to 6
  66.         if (gBlinker mod 2) = 1 then
  67.           startTimer()
  68.           repeat while the timer < 6
  69.             sprite(gEPuppet).visible = 0
  70.             updateStage()
  71.           end repeat
  72.         end if
  73.         if (gBlinker mod 2) = 0 then
  74.           startTimer()
  75.           repeat while the timer < 6
  76.             sprite(gEPuppet).visible = 1
  77.             updateStage()
  78.           end repeat
  79.         end if
  80.       end repeat
  81.       puppetSound(2, "red piece")
  82.       sprite(gEPuppet).visible = 1
  83.       gEPuppet = gEPuppet + 1
  84.     else
  85.       AI_Random()
  86.       gGameBoard[gEKountV][gEKountH] = 2
  87.       gEMoves = gEMoves + 1
  88.       gCompsTurn = 0
  89.       sprite(gEPuppet).puppet = 1
  90.       sprite(gEPuppet).member = "red bead"
  91.       sprite(gEPuppet).loc = point(55 + (gEKountH * 30), 7 + (gEKountV * 30))
  92.       repeat with gBlinker = 1 to 6
  93.         if (gBlinker mod 2) = 1 then
  94.           startTimer()
  95.           repeat while the timer < 6
  96.             sprite(gEPuppet).visible = 0
  97.             updateStage()
  98.           end repeat
  99.         end if
  100.         if (gBlinker mod 2) = 0 then
  101.           startTimer()
  102.           repeat while the timer < 6
  103.             sprite(gEPuppet).visible = 1
  104.             updateStage()
  105.           end repeat
  106.         end if
  107.       end repeat
  108.       puppetSound(2, "red piece")
  109.       sprite(gEPuppet).visible = 1
  110.       gEPuppet = gEPuppet + 1
  111.     end if
  112.   end if
  113. end
  114.  
  115. on PlayerWin
  116.   repeat with gKounterV = 1 to 13
  117.     repeat with gKounterH = 1 to 13
  118.       if (gKounterH >= 2) and (gKounterH < 9) then
  119.         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
  120.           repeat with gAdd5Xs = 0 to 4
  121.             sprite(286 + gAdd5Xs).puppet = 1
  122.             sprite(286 + gAdd5Xs).member = "black x red trim"
  123.             sprite(286 + gAdd5Xs).loc = point(55 + ((gKounterH + gAdd5Xs) * 30), 7 + (gKounterV * 30))
  124.           end repeat
  125.           gPlaying = 0
  126.           startTimer()
  127.           go(15)
  128.         end if
  129.       else
  130.         if gKounterH = 1 then
  131.           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
  132.             repeat with gAdd5Xs = 0 to 4
  133.               sprite(286 + gAdd5Xs).puppet = 1
  134.               sprite(286 + gAdd5Xs).member = "black x red trim"
  135.               sprite(286 + gAdd5Xs).loc = point(55 + ((gKounterH + gAdd5Xs) * 30), 7 + (gKounterV * 30))
  136.             end repeat
  137.             gPlaying = 0
  138.             startTimer()
  139.             go(15)
  140.           end if
  141.         else
  142.           if gKounterH = 9 then
  143.             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
  144.               repeat with gAdd5Xs = 0 to 4
  145.                 sprite(286 + gAdd5Xs).puppet = 1
  146.                 sprite(286 + gAdd5Xs).member = "black x red trim"
  147.                 sprite(286 + gAdd5Xs).loc = point(55 + ((gKounterH + gAdd5Xs) * 30), 7 + (gKounterV * 30))
  148.               end repeat
  149.               gPlaying = 0
  150.               startTimer()
  151.               go(15)
  152.             end if
  153.           end if
  154.         end if
  155.       end if
  156.       if (gKounterV >= 2) and (gKounterV < 9) then
  157.         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
  158.           repeat with gAdd5Xs = 0 to 4
  159.             sprite(286 + gAdd5Xs).puppet = 1
  160.             sprite(286 + gAdd5Xs).member = "black x red trim"
  161.             sprite(286 + gAdd5Xs).loc = point(55 + (gKounterH * 30), 7 + ((gKounterV + gAdd5Xs) * 30))
  162.           end repeat
  163.           gPlaying = 0
  164.           startTimer()
  165.           go(15)
  166.         end if
  167.       else
  168.         if gKounterV = 1 then
  169.           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
  170.             repeat with gAdd5Xs = 0 to 4
  171.               sprite(286 + gAdd5Xs).puppet = 1
  172.               sprite(286 + gAdd5Xs).member = "black x red trim"
  173.               sprite(286 + gAdd5Xs).loc = point(55 + (gKounterH * 30), 7 + ((gKounterV + gAdd5Xs) * 30))
  174.             end repeat
  175.             gPlaying = 0
  176.             startTimer()
  177.             go(15)
  178.           end if
  179.         else
  180.           if gKounterV = 9 then
  181.             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
  182.               repeat with gAdd5Xs = 0 to 4
  183.                 sprite(286 + gAdd5Xs).puppet = 1
  184.                 sprite(286 + gAdd5Xs).member = "black x red trim"
  185.                 sprite(286 + gAdd5Xs).loc = point(55 + (gKounterH * 30), 7 + ((gKounterV + gAdd5Xs) * 30))
  186.               end repeat
  187.               gPlaying = 0
  188.               startTimer()
  189.               go(15)
  190.             end if
  191.           end if
  192.         end if
  193.       end if
  194.       if (gKounterV >= 2) and (gKounterV < 9) and ((gKounterH >= 2) and (gKounterH < 9)) then
  195.         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
  196.           repeat with gAdd5Xs = 0 to 4
  197.             sprite(286 + gAdd5Xs).puppet = 1
  198.             sprite(286 + gAdd5Xs).member = "black x red trim"
  199.             sprite(286 + gAdd5Xs).loc = point(55 + ((gKounterH + gAdd5Xs) * 30), 7 + ((gKounterV + gAdd5Xs) * 30))
  200.           end repeat
  201.           gPlaying = 0
  202.           startTimer()
  203.           go(15)
  204.         end if
  205.       else
  206.         if (gKounterV = 1) and (gKounterH <= 9) then
  207.           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
  208.             repeat with gAdd5Xs = 0 to 4
  209.               sprite(286 + gAdd5Xs).puppet = 1
  210.               sprite(286 + gAdd5Xs).member = "black x red trim"
  211.               sprite(286 + gAdd5Xs).loc = point(55 + ((gKounterH + gAdd5Xs) * 30), 7 + ((gKounterV + gAdd5Xs) * 30))
  212.             end repeat
  213.             gPlaying = 0
  214.             startTimer()
  215.             go(15)
  216.           end if
  217.         else
  218.           if (gKounterV = 9) and (gKounterH >= 2) and (gKounterH <= 9) then
  219.             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
  220.               repeat with gAdd5Xs = 0 to 4
  221.                 sprite(286 + gAdd5Xs).puppet = 1
  222.                 sprite(286 + gAdd5Xs).member = "black x red trim"
  223.                 sprite(286 + gAdd5Xs).loc = point(55 + ((gKounterH + gAdd5Xs) * 30), 7 + ((gKounterV + gAdd5Xs) * 30))
  224.               end repeat
  225.               gPlaying = 0
  226.               startTimer()
  227.               go(15)
  228.             end if
  229.           else
  230.             if (gKounterV = 9) and (gKounterH = 1) then
  231.               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
  232.                 repeat with gAdd5Xs = 0 to 4
  233.                   sprite(286 + gAdd5Xs).puppet = 1
  234.                   sprite(286 + gAdd5Xs).member = "black x red trim"
  235.                   sprite(286 + gAdd5Xs).loc = point(55 + ((gKounterH + gAdd5Xs) * 30), 7 + ((gKounterV + gAdd5Xs) * 30))
  236.                 end repeat
  237.                 gPlaying = 0
  238.                 startTimer()
  239.                 go(15)
  240.               end if
  241.             end if
  242.           end if
  243.         end if
  244.       end if
  245.       if (gKounterV > 5) and (gKounterV < 13) and ((gKounterH >= 2) and (gKounterH < 9)) then
  246.         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
  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(55 + ((gKounterH + gAdd5Xs) * 30), 7 + ((gKounterV - gAdd5Xs) * 30))
  251.           end repeat
  252.           gPlaying = 0
  253.           startTimer()
  254.           go(15)
  255.         end if
  256.       else
  257.         if (gKounterV = 13) and (gKounterH <= 9) then
  258.           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
  259.             repeat with gAdd5Xs = 0 to 4
  260.               sprite(286 + gAdd5Xs).puppet = 1
  261.               sprite(286 + gAdd5Xs).member = "black x red trim"
  262.               sprite(286 + gAdd5Xs).loc = point(55 + ((gKounterH + gAdd5Xs) * 30), 7 + ((gKounterV - gAdd5Xs) * 30))
  263.             end repeat
  264.             gPlaying = 0
  265.             startTimer()
  266.             go(15)
  267.           end if
  268.         else
  269.           if (gKounterV = 5) and (gKounterH = 1) then
  270.             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
  271.               repeat with gAdd5Xs = 0 to 4
  272.                 sprite(286 + gAdd5Xs).puppet = 1
  273.                 sprite(286 + gAdd5Xs).member = "black x red trim"
  274.                 sprite(286 + gAdd5Xs).loc = point(55 + ((gKounterH + gAdd5Xs) * 30), 7 + ((gKounterV - gAdd5Xs) * 30))
  275.               end repeat
  276.               gPlaying = 0
  277.               startTimer()
  278.               go(15)
  279.             end if
  280.           else
  281.             if (gKounterV = 5) and (gKounterH >= 2) and (gKounterH <= 9) then
  282.               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
  283.                 repeat with gAdd5Xs = 0 to 4
  284.                   sprite(286 + gAdd5Xs).puppet = 1
  285.                   sprite(286 + gAdd5Xs).member = "black x red trim"
  286.                   sprite(286 + gAdd5Xs).loc = point(55 + ((gKounterH + gAdd5Xs) * 30), 7 + ((gKounterV - gAdd5Xs) * 30))
  287.                 end repeat
  288.                 gPlaying = 0
  289.                 startTimer()
  290.                 go(15)
  291.               end if
  292.             end if
  293.           end if
  294.         end if
  295.       end if
  296.       if gGameBoard[gKounterV][gKounterH] <> 0 then
  297.         gFullBoard = gFullBoard + 1
  298.       end if
  299.       if gFullBoard >= 169 then
  300.         gFullBoard = 0
  301.         gPlaying = 0
  302.         go(34)
  303.         put "3"
  304.       end if
  305.     end repeat
  306.   end repeat
  307.   gFullBoard = 0
  308. end
  309.