home *** CD-ROM | disk | FTP | other *** search
Wrap
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 on prepareMovie 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]] cursor(member("blackBeadCursor")) gKounterH = 1 gKounterV = 1 gPuppeter = 20 singleUndo = 1 gPlaying = 1 gELineHolder = [0, 0, 0, 0, 0] gELineDirection = random(9) gCompsTurn = 0 gEPuppet = 220 gEMoves = 0 gETrys = 0 gEKountV = 1 gEKountH = 1 gNuLine = 1 gEBalls = 1 gNuMapPosX = 0 gNuMapPosY = 0 gKountY = 1 gKountX = 1 gESaveLength = 0 gLineDot = 1 gEWinX = 1 gEWinY = 1 gAdd5Xs = 1 gFullBoard = 0 gBlinker = 0 sprite(1).member = "pro-go-moku_move1" startTimer() end on enterFrame if gPlaying = 1 then PlayerMove() PlayerWin() if gPlaying = 1 then EnemyMove() EnemyWin() end if if sprite(1).member.name = "pro-go-moku" then if ((the mouseH < 55) and (the mouseV < 378)) or (the mouseH > 477) then cursor(member("noNoCursor")) else cursor(member("blackBeadCursor")) end if else if sprite(1).member.name = "pro-go-moku_move1" then 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 cursor(member("blackBeadCursor")) else cursor(member("noNoCursor")) end if else if sprite(1).member.name = "pro-go-moku_move2" then 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 cursor(member("noNoCursor")) else cursor(member("blackBeadCursor")) end if end if end if end if else cursor(0) end if end on EnemyMove me if gCompsTurn = 1 then cursor(4) gCompsTurn = 0 AI_Block(me) if gGameBoard[gEKountV][gEKountH] = 0 then gGameBoard[gEKountV][gEKountH] = 2 gEMoves = gEMoves + 1 gCompsTurn = 0 sprite(gEPuppet).puppet = 1 sprite(gEPuppet).member = "red bead" sprite(gEPuppet).loc = point(59 + (gEKountH * 26), 10 + (gEKountV * 26)) repeat with gBlinker = 1 to 6 if (gBlinker mod 2) = 1 then startTimer() repeat while the timer < 6 sprite(gEPuppet).visible = 0 updateStage() end repeat end if if (gBlinker mod 2) = 0 then startTimer() repeat while the timer < 6 sprite(gEPuppet).visible = 1 updateStage() end repeat end if end repeat puppetSound(2, "red piece") sprite(gEPuppet).visible = 1 gEPuppet = gEPuppet + 1 else AI_Random() gGameBoard[gEKountV][gEKountH] = 2 gEMoves = gEMoves + 1 gCompsTurn = 0 sprite(gEPuppet).puppet = 1 sprite(gEPuppet).member = "red bead" sprite(gEPuppet).loc = point(59 + (gEKountH * 26), 10 + (gEKountV * 26)) repeat with gBlinker = 1 to 6 if (gBlinker mod 2) = 1 then startTimer() repeat while the timer < 6 sprite(gEPuppet).visible = 0 updateStage() end repeat end if if (gBlinker mod 2) = 0 then startTimer() repeat while the timer < 6 sprite(gEPuppet).visible = 1 updateStage() end repeat end if end repeat puppetSound(2, "red piece") sprite(gEPuppet).visible = 1 gEPuppet = gEPuppet + 1 end if end if end on PlayerWin repeat with gKounterV = 1 to 15 repeat with gKounterH = 1 to 15 if (gKounterH >= 2) and (gKounterH < 11) then 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 repeat with gAdd5Xs = 0 to 4 sprite(286 + gAdd5Xs).puppet = 1 sprite(286 + gAdd5Xs).member = "black x red trim" sprite(286 + gAdd5Xs).loc = point(59 + ((gKounterH + gAdd5Xs) * 26), 10 + (gKounterV * 26)) end repeat gPlaying = 0 startTimer() go(15) end if else if gKounterH = 1 then 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 repeat with gAdd5Xs = 0 to 4 sprite(286 + gAdd5Xs).puppet = 1 sprite(286 + gAdd5Xs).member = "black x red trim" sprite(286 + gAdd5Xs).loc = point(59 + ((gKounterH + gAdd5Xs) * 26), 10 + (gKounterV * 26)) end repeat gPlaying = 0 startTimer() go(15) end if else if gKounterH = 11 then 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 repeat with gAdd5Xs = 0 to 4 sprite(286 + gAdd5Xs).puppet = 1 sprite(286 + gAdd5Xs).member = "black x red trim" sprite(286 + gAdd5Xs).loc = point(59 + ((gKounterH + gAdd5Xs) * 26), 10 + (gKounterV * 26)) end repeat gPlaying = 0 startTimer() go(15) end if end if end if end if if (gKounterV >= 2) and (gKounterV < 11) then 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 repeat with gAdd5Xs = 0 to 4 sprite(286 + gAdd5Xs).puppet = 1 sprite(286 + gAdd5Xs).member = "black x red trim" sprite(286 + gAdd5Xs).loc = point(59 + (gKounterH * 26), 10 + ((gKounterV + gAdd5Xs) * 26)) end repeat gPlaying = 0 startTimer() go(15) end if else if gKounterV = 1 then 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 repeat with gAdd5Xs = 0 to 4 sprite(286 + gAdd5Xs).puppet = 1 sprite(286 + gAdd5Xs).member = "black x red trim" sprite(286 + gAdd5Xs).loc = point(59 + (gKounterH * 26), 10 + ((gKounterV + gAdd5Xs) * 26)) end repeat gPlaying = 0 startTimer() go(15) end if else if gKounterV = 11 then 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 repeat with gAdd5Xs = 0 to 4 sprite(286 + gAdd5Xs).puppet = 1 sprite(286 + gAdd5Xs).member = "black x red trim" sprite(286 + gAdd5Xs).loc = point(59 + (gKounterH * 26), 10 + ((gKounterV + gAdd5Xs) * 26)) end repeat gPlaying = 0 startTimer() go(15) end if end if end if end if if (gKounterV >= 2) and (gKounterV < 11) and ((gKounterH >= 2) and (gKounterH < 11)) then 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 repeat with gAdd5Xs = 0 to 4 sprite(286 + gAdd5Xs).puppet = 1 sprite(286 + gAdd5Xs).member = "black x red trim" sprite(286 + gAdd5Xs).loc = point(59 + ((gKounterH + gAdd5Xs) * 26), 10 + ((gKounterV + gAdd5Xs) * 26)) end repeat gPlaying = 0 startTimer() go(15) end if else if (gKounterV = 1) and (gKounterH <= 11) then 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 repeat with gAdd5Xs = 0 to 4 sprite(286 + gAdd5Xs).puppet = 1 sprite(286 + gAdd5Xs).member = "black x red trim" sprite(286 + gAdd5Xs).loc = point(59 + ((gKounterH + gAdd5Xs) * 26), 10 + ((gKounterV + gAdd5Xs) * 26)) end repeat gPlaying = 0 startTimer() go(15) end if else if (gKounterV = 11) and (gKounterH >= 2) and (gKounterH <= 11) then 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 repeat with gAdd5Xs = 0 to 4 sprite(286 + gAdd5Xs).puppet = 1 sprite(286 + gAdd5Xs).member = "black x red trim" sprite(286 + gAdd5Xs).loc = point(59 + ((gKounterH + gAdd5Xs) * 26), 10 + ((gKounterV + gAdd5Xs) * 26)) end repeat gPlaying = 0 startTimer() go(15) end if else if (gKounterV = 11) and (gKounterH = 1) then 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 repeat with gAdd5Xs = 0 to 4 sprite(286 + gAdd5Xs).puppet = 1 sprite(286 + gAdd5Xs).member = "black x red trim" sprite(286 + gAdd5Xs).loc = point(59 + ((gKounterH + gAdd5Xs) * 26), 10 + ((gKounterV + gAdd5Xs) * 26)) end repeat gPlaying = 0 startTimer() go(15) end if end if end if end if end if if (gKounterV > 5) and (gKounterV < 15) and ((gKounterH >= 2) and (gKounterH < 11)) then 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 repeat with gAdd5Xs = 0 to 4 sprite(286 + gAdd5Xs).puppet = 1 sprite(286 + gAdd5Xs).member = "black x red trim" sprite(286 + gAdd5Xs).loc = point(59 + ((gKounterH + gAdd5Xs) * 26), 10 + ((gKounterV - gAdd5Xs) * 26)) end repeat gPlaying = 0 startTimer() go(15) end if else if (gKounterV = 15) and (gKounterH <= 11) then 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 repeat with gAdd5Xs = 0 to 4 sprite(286 + gAdd5Xs).puppet = 1 sprite(286 + gAdd5Xs).member = "black x red trim" sprite(286 + gAdd5Xs).loc = point(59 + ((gKounterH + gAdd5Xs) * 26), 10 + ((gKounterV - gAdd5Xs) * 26)) end repeat gPlaying = 0 startTimer() go(15) end if else if (gKounterV = 5) and (gKounterH = 1) then 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 repeat with gAdd5Xs = 0 to 4 sprite(286 + gAdd5Xs).puppet = 1 sprite(286 + gAdd5Xs).member = "black x red trim" sprite(286 + gAdd5Xs).loc = point(59 + ((gKounterH + gAdd5Xs) * 26), 10 + ((gKounterV - gAdd5Xs) * 26)) end repeat gPlaying = 0 startTimer() go(15) end if else if (gKounterV = 5) and (gKounterH >= 2) and (gKounterH <= 11) then 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 repeat with gAdd5Xs = 0 to 4 sprite(286 + gAdd5Xs).puppet = 1 sprite(286 + gAdd5Xs).member = "black x red trim" sprite(286 + gAdd5Xs).loc = point(59 + ((gKounterH + gAdd5Xs) * 26), 10 + ((gKounterV - gAdd5Xs) * 26)) end repeat gPlaying = 0 startTimer() go(15) end if end if end if end if end if if gGameBoard[gKounterV][gKounterH] <> 0 then gFullBoard = gFullBoard + 1 end if if gFullBoard >= 169 then gFullBoard = 0 gPlaying = 0 go(34) put "3" end if end repeat end repeat gFullBoard = 0 end