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 verticalAData, verticalBData, horizontalAData, horizontalBData, blankMapData, solidData, levelWidth
- solidData = []
- repeat with whichY = 1 to 10
- oneLiner = []
- repeat with whichX = 1 to levelWidth
- add(oneLiner, 0)
- end repeat
- add(solidData, oneLiner.value)
- end repeat
- repeat with whichY = 1 to 10
- repeat with whichX = 1 to levelWidth
- if verticalAData[whichY][whichX] = 1 then
- solidData[whichY][whichX] = 1
- next repeat
- end if
- if verticalBData[whichY][whichX] = 1 then
- solidData[whichY][whichX] = 1
- next repeat
- end if
- if horizontalAData[whichY][whichX] = 1 then
- solidData[whichY][whichX] = 1
- next repeat
- end if
- if horizontalBData[whichY][whichX] = 1 then
- solidData[whichY][whichX] = 1
- end if
- end repeat
- end repeat
- end
-
- on setBlock h1, h2, v1, v2
- sprite(4).visible = h1
- sprite(5).visible = h2
- sprite(6).visible = v1
- sprite(7).visible = v2
- end
-
- on simulateGravity
- global verticalAData, verticalBData, horizontalAData, horizontalBData, blankMapData, solidData, rippleData, levelWidth
- wSprite = 10
- repeat with whichY = 1 to 10
- 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 * 40, (whichY * 40) - rBit) + the loc of sprite 2 - 20
- else
- set the loc of sprite wSprite to point(whichX * 40, whichY * 40) + the loc of sprite 2 - 20
- end if
- if whichY <= 9 then
- if solidData[whichY][whichX] <> 0 then
- if solidData[whichY + 1][whichX] = 0 then
- recMod = [0, 0, 0, 0]
- recMod[1] = verticalAData[whichY][whichX]
- recMod[2] = verticalBData[whichY][whichX]
- recMod[3] = horizontalAData[whichY][whichX]
- recMod[4] = horizontalBData[whichY][whichX]
- verticalAData[whichY][whichX] = 0
- verticalBData[whichY][whichX] = 0
- horizontalAData[whichY][whichX] = 0
- horizontalBData[whichY][whichX] = 0
- verticalAData[whichY + 1][whichX] = recMod[1]
- verticalBData[whichY + 1][whichX] = recMod[2]
- horizontalAData[whichY + 1][whichX] = recMod[3]
- horizontalBData[whichY + 1][whichX] = recMod[4]
- rippleData[whichY + 1][whichX] = rippleData[whichY][whichX] + 40
- 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 scanConnections
- global verticalAData, verticalBData, horizontalAData, horizontalBData, blankMapData, solidData, levelWidth, playerScore
- vTestAData = blankMapData
- totalScores = 0
- repeat with whichX = 1 to levelWidth
- repeat with whichY = 1 to 8
- if verticalAData[whichY][whichX] = 1 then
- if verticalAData[whichY + 1][whichX] = 1 then
- if verticalAData[whichY + 2][whichX] = 1 then
- verticalAData[whichY][whichX] = 0
- verticalAData[whichY + 1][whichX] = 0
- verticalAData[whichY + 2][whichX] = 0
- totalScores = totalScores + 1
- end if
- end if
- end if
- if verticalBData[whichY][whichX] = 1 then
- if verticalBData[whichY + 1][whichX] = 1 then
- if verticalBData[whichY + 2][whichX] = 1 then
- verticalBData[whichY][whichX] = 0
- verticalBData[whichY + 1][whichX] = 0
- verticalBData[whichY + 2][whichX] = 0
- totalScores = totalScores + 1
- end if
- end if
- end if
- end repeat
- end repeat
- repeat with whichY = 1 to 10
- repeat with whichX = 1 to levelWidth - 2
- if horizontalAData[whichY][whichX] = 1 then
- if horizontalAData[whichY][whichX + 1] = 1 then
- if horizontalAData[whichY][whichX + 2] = 1 then
- horizontalAData[whichY][whichX] = 0
- horizontalAData[whichY][whichX + 1] = 0
- horizontalAData[whichY][whichX + 2] = 0
- totalScores = totalScores + 1
- end if
- end if
- end if
- if horizontalBData[whichY][whichX] = 1 then
- if horizontalBData[whichY][whichX + 1] = 1 then
- if horizontalBData[whichY][whichX + 2] = 1 then
- horizontalBData[whichY][whichX] = 0
- horizontalBData[whichY][whichX + 1] = 0
- horizontalBData[whichY][whichX + 2] = 0
- totalScores = totalScores + 1
- end if
- end if
- end if
- end repeat
- end repeat
- playerScore = playerScore + (totalScores * totalScores * 10)
- if totalScores > 0 then
- playSound("Dissapear", 2)
- end if
- put playerScore into member "Player Score"
- end
-
- on playSound whichSound, whichSlot
- sound(whichSlot).stop()
- sound(whichSlot).queue([#member: member(whichSound)])
- sound(whichSlot).play()
- end
-