home *** CD-ROM | disk | FTP | other *** search
- on scanRemovals
- global shadowShapeData, shadowSpinData, blankMapData, solidData, levelWidth
- vTestAData = blankMapData
- totalScores = 0
- levelWidth = 7
- levelheight = 8
- repeat with whichX = 1 to levelWidth
- repeat with whichY = 1 to levelheight
- if whichY <= (levelheight - 1) then
- testCore = shadowShapeData[whichY][whichX]
- if shadowShapeData[whichY][whichX] <> 0 then
- if shadowShapeData[whichY + 1][whichX] = testCore then
- shadowShapeData[whichY][whichX] = 0
- shadowShapeData[whichY + 1][whichX] = 0
- totalScores = totalScores + 1
- end if
- end if
- end if
- end repeat
- end repeat
- end
-
- on scanConnections
- global shadowShapeData, shadowSpinData, shadowSolidData, blankMapData, solidData, levelWidth, playerScore, playerlevel
- vTestAData = blankMapData
- totalScores = 0
- levelWidth = 7
- levelheight = 8
- removalMap = []
- repeat with wY = 1 to levelheight
- oneLiner = []
- repeat with wX = 1 to levelWidth
- add(oneLiner, 0)
- end repeat
- add(removalMap, oneLiner)
- end repeat
- totalEliminations = 0
- repeat with whichX = 1 to levelWidth
- repeat with whichY = 1 to levelheight
- if whichX <= (levelWidth - 2) then
- testCore = shadowShapeData[whichY][whichX]
- testSpinny = shadowSpinData[whichY][whichX]
- if shadowShapeData[whichY][whichX] <> 0 then
- if shadowShapeData[whichY][whichX + 1] = testCore then
- if shadowShapeData[whichY][whichX + 2] = testCore then
- if shadowSpinData[whichY][whichX + 1] = testSpinny then
- if shadowSpinData[whichY][whichX + 2] = testSpinny then
- if (shadowSolidData[whichY][whichX] = 0) or (shadowSolidData[whichY][whichX + 1] = 0) or (shadowSolidData[whichY][whichX + 2] = 0) then
- removalMap[whichY][whichX] = 1
- removalMap[whichY][whichX + 1] = 1
- removalMap[whichY][whichX + 2] = 1
- repeat with wVector = 1 to 3
- case shadowSolidData[whichY][whichX - 1 + wVector] of
- 0:
- totalEliminations = totalEliminations + 1
- 1:
- totalEliminations = totalEliminations + 5
- end case
- end repeat
- shadowSolidData[whichY][whichX] = 0
- shadowSolidData[whichY][whichX + 1] = 0
- shadowSolidData[whichY][whichX + 2] = 0
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- if whichY <= (levelheight - 2) then
- testCore = shadowShapeData[whichY][whichX]
- testSpinny = shadowSpinData[whichY][whichX]
- if shadowShapeData[whichY][whichX] <> 0 then
- if shadowShapeData[whichY + 1][whichX] = testCore then
- if shadowShapeData[whichY + 2][whichX] = testCore then
- if shadowSpinData[whichY + 1][whichX] = testSpinny then
- if shadowSpinData[whichY + 2][whichX] = testSpinny then
- if (shadowSolidData[whichY][whichX] = 0) or (shadowSolidData[whichY + 1][whichX] = 0) or (shadowSolidData[whichY + 2][whichX] = 0) then
- removalMap[whichY][whichX] = 1
- removalMap[whichY + 1][whichX] = 1
- removalMap[whichY + 2][whichX] = 1
- repeat with wVector = 1 to 3
- case shadowSolidData[whichY - 1 + wVector][whichX] of
- 0:
- totalEliminations = totalEliminations + 1
- 1:
- totalEliminations = totalEliminations + 10
- end case
- end repeat
- shadowSolidData[whichY][whichX] = 0
- shadowSolidData[whichY + 1][whichX] = 0
- shadowSolidData[whichY + 2][whichX] = 0
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- end repeat
- end repeat
- if totalEliminations > 0 then
- playerScore = playerScore + (totalEliminations * 10)
- member("Score Display").text = string(playerScore)
- totalScores = 0
- totalShadowBLocks = 0
- repeat with whichX = 1 to levelWidth
- repeat with whichY = 1 to levelheight
- if removalMap[whichY][whichX] = 1 then
- shadowShapeData[whichY][whichX] = 0
- totalScores = totalScores + 1
- end if
- if shadowSolidData[whichY][whichX] = 1 then
- totalShadowBLocks = totalShadowBLocks + 1
- end if
- end repeat
- end repeat
- member("Blocks Display").text = string(totalShadowBLocks)
- member("Level Display").text = string(playerlevel)
- end if
- end
-
- on updateShadowDisplay
- global shadowSolidData, shadowShapeData, levelWidth, levelheight
- totalShadowBLocks = 0
- repeat with whichX = 1 to levelWidth
- repeat with whichY = 1 to count(shadowSolidData)
- if shadowSolidData[whichY][whichX] = 1 then
- totalShadowBLocks = totalShadowBLocks + 1
- end if
- end repeat
- end repeat
- member("Blocks Display").text = string(totalShadowBLocks)
- end
-