home *** CD-ROM | disk | FTP | other *** search
- on translateSet horizontalA, horizontalB, verticalA, verticalB
- finalTest = horizontalA + (horizontalB * 2) + (verticalA * 4) + (verticalB * 8)
- memDat = [1, 7, 0]
- memberType = "nothing"
- case finalTest of
- 0:
- memDat = [1, 6, 0]
- 1:
- memDat = [1, 1, 0]
- 2:
- memDat = [1, 1, 180]
- 3:
- memDat = [1, 3, 90]
- 4:
- memDat = [1, 1, 270]
- 5:
- memDat = [1, 2, 0]
- 6:
- memDat = [1, 2, 270]
- 7:
- memDat = [1, 4, 270]
- 8:
- memDat = [1, 1, 90]
- 9:
- memDat = [1, 2, 90]
- 10:
- memDat = [1, 2, 180]
- 11:
- memDat = [1, 4, 90]
- 12:
- memDat = [1, 3, 0]
- 13:
- memDat = [1, 4, 0]
- 14:
- memDat = [1, 4, 180]
- 15:
- memDat = [1, 5, 0]
- 16:
- memDat = [1, 5, 0]
- 30:
- memDat = [1, 8, 0]
- 45:
- memDat = [1, 9, 0]
- end case
- return memDat
- end
-
- on testSolidity
- global shadowShapeData, blankMapData, solidData, levelWidth
- solidData = []
- repeat with whichY = 1 to count(shadowShapeData)
- oneLiner = []
- repeat with whichX = 1 to levelWidth
- add(oneLiner, 0)
- end repeat
- add(solidData, oneLiner.value)
- end repeat
- repeat with whichY = 1 to count(shadowShapeData)
- repeat with whichX = 1 to levelWidth
- if shadowShapeData[whichY][whichX] <> 0 then
- solidData[whichY][whichX] = 1
- end if
- end repeat
- end repeat
- end
-
- on setBlock sType, sRotate
- set the member of sprite 245 to "Shape " & string(sType)
- sprite(245).rotation = sRotate * 90
- end
-
- on simulateGravity
- global shadowShapeData, shadowSpinData, blankMapData, solidData, rippleData, levelWidth, tileSize, shadowSolidData
- wSprite = 10
- repeat with whichY = 1 to count(shadowShapeData)
- repeat with whichX = 1 to levelWidth
- if rippleData[whichY][whichX] > 0 then
- rippleData[whichY][whichX] = rippleData[whichY][whichX] - 10
- if rippleData[whichY][whichX] < 0 then
- rippleData[whichY][whichX] = 0
- end if
- rBit = rippleData[whichY][whichX]
- set the loc of sprite wSprite to point(whichX * tileSize, (whichY * tileSize) - rBit) + the loc of sprite 2 - (tileSize / 2)
- else
- set the loc of sprite wSprite to point(whichX * tileSize, whichY * tileSize) + the loc of sprite 2 - (tileSize / 2)
- end if
- if whichY <= (count(shadowShapeData) - 1) then
- if solidData[whichY][whichX] <> 0 then
- if solidData[whichY + 1][whichX] = 0 then
- recMod = [0, 0, 0, 0]
- recMod[1] = shadowShapeData[whichY][whichX]
- recMod[2] = shadowSpinData[whichY][whichX]
- recMod[3] = shadowSolidData[whichY][whichX]
- shadowShapeData[whichY][whichX] = 0
- shadowSpinData[whichY][whichX] = 0
- shadowSolidData[whichY][whichX] = 0
- shadowShapeData[whichY + 1][whichX] = recMod[1]
- shadowSpinData[whichY + 1][whichX] = recMod[2]
- shadowSolidData[whichY + 1][whichX] = recMod[3]
- rippleData[whichY + 1][whichX] = rippleData[whichY][whichX] + tileSize
- rippleData[whichY][whichX] = 0
- solidData[whichY][whichX] = 0
- solidData[whichY + 1][whichX] = 1
- end if
- end if
- end if
- wSprite = wSprite + 1
- end repeat
- end repeat
- end
-
- on addToQue
- global maxShapeList, playerlevel, stampShapeQue, stampSpinQue
- newStamp = random(3 + playerlevel)
- add(stampShapeQue, newStamp)
- add(stampSpinQue, 1)
- end
-
- on scanLevelComplete
- global shadowShapeData, shadowSpinData, shadowSolidData, blankMapData, solidData, levelWidth, checkSafe, playerlevel, playerScore, levelScore
- ghostDetected = 0
- repeat with yScan = 1 to count(shadowSolidData)
- repeat with xScan = 1 to count(shadowSolidData[1])
- if shadowSolidData[yScan][xScan] = 1 then
- ghostDetected = 1
- end if
- end repeat
- end repeat
- if ghostDetected = 0 then
- playerlevel = playerlevel + 1
- member("Level Display").text = string(playerlevel)
- if playerlevel = 4 then
- go(20)
- else
- playSound("Added Blocks SFX", 1)
- repeat with yScan = 1 to count(shadowSolidData)
- repeat with xScan = 1 to count(shadowSolidData[1])
- if (yScan > 1) and (yScan <= (playerlevel + 1)) then
- if shadowShapeData[yScan][xScan] = 0 then
- shadowSolidData[yScan][xScan] = 1
- shadowShapeData[yScan][xScan] = 3 + random(playerlevel)
- shadowSpinData[yScan][xScan] = random(4)
- end if
- end if
- end repeat
- end repeat
- updateShadowDisplay()
- end if
- end if
- end
-
- on scanLevelCompleteDefunct
- global shadowShapeData, shadowSpinData, shadowSolidData, blankMapData, solidData, levelWidth, checkSafe, playerlevel, playerScore, levelScore
- vTestAData = blankMapData
- totalScores = 0
- tileShapeOne = shadowShapeData[8][1]
- tileSpinOne = shadowSpinData[8][1]
- checkSafe = 1
- if (tileShapeOne <> 0) and (tileSpinOne <> 0) then
- repeat with whichX = 2 to levelWidth
- whichY = 8
- if (shadowShapeData[whichY][whichX] <> tileShapeOne) or (shadowSpinData[whichY][whichX] <> tileSpinOne) then
- checkSafe = 0
- end if
- end repeat
- else
- checkSafe = 0
- end if
- if checkSafe = 1 then
- repeat with whichX = 1 to levelWidth
- whichY = 8
- shadowShapeData[whichY][whichX] = 0
- shadowSpinData[whichY][whichX] = 0
- end repeat
- spareBlocks = 0
- repeat with xS = 1 to count(shadowShapeData[1])
- repeat with yS = 1 to count(shadowShapeData)
- if shadowShapeData[yS][xS] <> 0 then
- spareBlocks = spareBlocks + 1
- end if
- end repeat
- end repeat
- maxShapeList = 5 + playerlevel
- if maxShapeList > 8 then
- maxShapeList = 8
- end if
- levelScore = 500 + (playerlevel * 500) - (spareBlocks * 50)
- playerScore = playerScore + levelScore
- if playerlevel < 5 then
- go(15)
- else
- go(20)
- end if
- else
- spareBlocks = 0
- repeat with xS = 1 to count(shadowShapeData[1])
- repeat with yS = 1 to count(shadowShapeData)
- if shadowShapeData[yS][xS] <> 0 then
- spareBlocks = spareBlocks + 1
- end if
- end repeat
- end repeat
- member("Blocks Display").text = string(spareBlocks)
- member("Score Display").text = string(playerScore)
- end if
- end
-
- on playSound whichSound, whichSlot
- global lastClear
- if whichSlot = 2 then
- sound(2).stop()
- sound(2).queue([#member: member(whichSound)])
- sound(2).play()
- else
- sound(1).stop()
- sound(1).queue([#member: member(whichSound)])
- sound(1).play()
- end if
- end
-