home *** CD-ROM | disk | FTP | other *** search
- global gCurrentLevel, gTotalScore, gTheMouseDownSprite, gSelectedSprite, gBombList, gPlayer1, gPlayer2, gPlayer3, gEnemy1, gEnemy2, gEnemy3, gInfluence, gPath, gTotalHealth
-
- on prepareMovie me
- gTotalHealth = 0
- gTotalScore = 0
- member("ScoreDisplay").text = string(gTotalScore)
- gInfluence = [[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 9, 9, 1, 1, 1, 1, 1], [1, 9, 9, 9, 9, 9, 1, 1, 1, 1, 1, 1, 1, 9, 9, 9, 9, 1, 1, 1, 1, 1], [1, 9, 9, 9, 9, 9, 9, 9, 1, 1, 1, 1, 9, 9, 9, 9, 1, 1, 9, 9, 1, 1], [1, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 1, 1, 9, 9, 9, 9, 1], [1, 1, 1, 1, 1, 1, 9, 9, 9, 9, 9, 9, 9, 1, 1, 1, 1, 9, 9, 9, 9, 1], [1, 1, 1, 1, 1, 1, 1, 9, 9, 9, 9, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 9, 9, 9, 9, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 9, 9, 9, 1, 1, 1, 1, 1, 1, 1, 9, 1, 1, 1], [1, 1, 1, 1, 9, 9, 9, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 9, 9, 1, 1], [1, 1, 1, 1, 9, 9, 9, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 9, 9, 1, 1], [1, 1, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 1, 1, 1, 9, 9, 9, 1, 1], [1, 1, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 9, 9, 9, 9, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 9, 9, 9, 1, 1, 1, 1], [9, 9, 9, 9, 9, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 9, 9, 1, 1, 1, 1], [9, 9, 9, 9, 9, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 9, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]]
- gCurrentLevel = 0
- gTotalScore = 0
- end
-
- on displayScore
- member("ScoreDisplay").text = string(gTotalScore)
- end
-
- on displayLevel
- member("LevelDisplay").text = string(gCurrentLevel)
- end
-
- on pathFind x1, y1, x2, y2
- found = 0
- gPath = [0]
- curNode = [x1, y1]
- gPath[1] = curNode
- curX = x1
- curY = y1
- repeat while found = 0
- if curX < x2 then
- nextX = curX + 1
- else
- if curX > x2 then
- nextX = curX - 1
- else
- nextX = curX
- end if
- end if
- if curY < y2 then
- nextY = curY + 1
- else
- if curY > y2 then
- nextY = curY - 1
- else
- nextY = curY
- end if
- end if
- if nextX <= 0 then
- nextX = 1
- end if
- if nextY <= 0 then
- nextY = 1
- end if
- if nextX > 22 then
- nextX = 22
- end if
- if nextY > 22 then
- nextY = 22
- end if
- curNode = [nextX, nextY]
- if (gInfluence[nextY][nextX] >= 9) or checkIfNodeThere(curNode) then
- nextX = curX + 1
- if curY < y2 then
- nextY = curY + 1
- else
- if curY > y2 then
- nextY = curY - 1
- else
- nextY = curY
- end if
- end if
- if nextX <= 0 then
- nextX = 1
- end if
- if nextY <= 0 then
- nextY = 1
- end if
- if nextX > 22 then
- nextX = 22
- end if
- if nextY > 22 then
- nextY = 22
- end if
- curNode = [nextX, nextY]
- if (gInfluence[nextY][nextX] >= 9) or checkIfNodeThere(curNode) then
- nextX = curX - 1
- if curY < y2 then
- nextY = curY + 1
- else
- if curY > y2 then
- nextY = curY - 1
- else
- nextY = curY
- end if
- end if
- if nextX <= 0 then
- nextX = 1
- end if
- if nextY <= 0 then
- nextY = 1
- end if
- if nextX > 22 then
- nextX = 22
- end if
- if nextY > 22 then
- nextY = 22
- end if
- curNode = [nextX, nextY]
- if (gInfluence[nextY][nextX] >= 9) or checkIfNodeThere(curNode) then
- nextX = curX
- if curY < y2 then
- nextY = curY + 1
- else
- if curY > y2 then
- nextY = curY - 1
- else
- nexY = curY
- end if
- end if
- if nextX <= 0 then
- nextX = 1
- end if
- if nextY <= 0 then
- nextY = 1
- end if
- if nextX > 22 then
- nextX = 22
- end if
- if nextY > 22 then
- nextY = 22
- end if
- curNode = [nextX, nextY]
- if (gInfluence[nextY][nextX] >= 9) or checkIfNodeThere(curNode) then
- nextX = curX - 1
- nextY = curY
- if nextX <= 0 then
- nextX = 1
- end if
- if nextY <= 0 then
- nextY = 1
- end if
- if nextX > 22 then
- nextX = 22
- end if
- if nextY > 22 then
- nextY = 22
- end if
- curNode = [nextX, nextY]
- if (gInfluence[nextY][nextX] >= 9) or checkIfNodeThere(curNode) then
- nextX = curX + 1
- nextY = curY
- if nextX <= 0 then
- nextX = 1
- end if
- if nextY <= 0 then
- nextY = 1
- end if
- if nextX > 22 then
- nextX = 22
- end if
- if nextY > 22 then
- nextY = 22
- end if
- curNode = [nextX, nextY]
- if (gInfluence[nextY][nextX] >= 9) or checkIfNodeThere(curNode) then
- if curX < x2 then
- nextX = curX + 1
- else
- if curX > x2 then
- nextX = curX - 1
- else
- nextX = curX
- end if
- end if
- nextY = curY - 1
- if nextX <= 0 then
- nextX = 1
- end if
- if nextY <= 0 then
- nextY = 1
- end if
- if nextX > 22 then
- nextX = 22
- end if
- if nextY > 22 then
- nextY = 22
- end if
- curNode = [nextX, nextY]
- if (gInfluence[nextY][nextX] >= 9) or checkIfNodeThere(curNode) then
- if curX < x2 then
- nextX = curX + 1
- else
- if curX > x2 then
- nextX = curX - 1
- else
- nextX = curX
- end if
- end if
- nextY = curY + 1
- if nextX <= 0 then
- nextX = 1
- end if
- if nextY <= 0 then
- nextY = 1
- end if
- if nextX > 22 then
- nextX = 22
- end if
- if nextY > 22 then
- nextY = 22
- end if
- curNode = [nextX, nextY]
- if (gInfluence[nextY][nextX] >= 9) or checkIfNodeThere(curNode) then
- nextX = curX - 1
- if curY < y2 then
- nextY = curY - 1
- else
- if curY > y2 then
- nextY = curY + 1
- else
- nextY = curY
- end if
- end if
- if nextX <= 0 then
- nextX = 1
- end if
- if nextY <= 0 then
- nextY = 1
- end if
- if nextX > 22 then
- nextX = 22
- end if
- if nextY > 22 then
- nextY = 22
- end if
- curNode = [nextX, nextY]
- if (gInfluence[nextY][nextX] >= 9) or checkIfNodeThere(curNode) then
- nextX = curX + 1
- if curY < y2 then
- nextY = curY + 1
- else
- if curY > y2 then
- nextY = curY - 1
- else
- nextY = curY
- end if
- end if
- if nextX <= 0 then
- nextX = 1
- end if
- if nextY <= 0 then
- nextY = 1
- end if
- if nextX > 22 then
- nextX = 22
- end if
- if nextY > 22 then
- nextY = 22
- end if
- curNode = [nextX, nextY]
- if (gInfluence[nextY][nextX] >= 9) or checkIfNodeThere(curNode) then
- nextX = curX
- if curY < y2 then
- nextY = curY + 1
- else
- if curY > y2 then
- nextY = curY - 1
- else
- nextY = curY
- end if
- end if
- if nextX <= 0 then
- nextX = 1
- end if
- if nextY <= 0 then
- nextY = 1
- end if
- if nextX > 22 then
- nextX = 22
- end if
- if nextY > 22 then
- nextY = 22
- end if
- curNode = [nextX, nextY]
- if checkIfNodeThere(curNode) = 1 then
- gPath = [0]
- gPath[1] = [x1, y1]
- return 0
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- curY = nextY
- curX = nextX
- curNode = [curX, curY]
- append(gPath, curNode)
- if (curX = x2) and (curY = y2) then
- found = 1
- return 1
- end if
- if count(gPath) > 200 then
- gPath = [0]
- gPath[1] = [x1, y1]
- end if
- end repeat
- end
-
- on checkIfNodeThere theNode
- there = 0
- repeat with counter = 1 to count(gPath)
- if gPath[counter] = theNode then
- there = 1
- end if
- end repeat
- return there
- end
-
- on getNextSprite
- gPlayer1.setAntDeSelected()
- gPlayer2.setAntDeSelected()
- gPlayer3.setAntDeSelected()
- gSelectedSprite = gSelectedSprite + 1
- if gSelectedSprite > 52 then
- gSelectedSprite = 50
- end if
- case gSelectedSprite of
- 50:
- if gPlayer1.pState = 3 then
- getNextSprite()
- exit
- end if
- 51:
- if gPlayer2.pState = 3 then
- getNextSprite()
- exit
- end if
- 52:
- if gPlayer3.pState = 3 then
- getNextSprite()
- exit
- end if
- end case
- case gSelectedSprite of
- 50:
- gPlayer1.setAntSelected()
- 51:
- gPlayer2.setAntSelected()
- 52:
- gPlayer3.setAntSelected()
- otherwise:
- sprite(16).blend = 0
- gSelectedSprite = 0
- end case
- sprite(16).loc = sprite(gSelectedSprite).loc
- end
-