home *** CD-ROM | disk | FTP | other *** search
- on exitFrame me
- global verticalAData, verticalBData, horizontalAData, horizontalBData, blankMapData, solidData, fallBlockData, mouseHold, flipstate, stampShape, nextStampShape, flipLevel, slideState, levelWidth, playerScore, gravityForce
- if keyPressed(49) = 1 then
- if slideState < 1 then
- slideState = slideState + 1
- end if
- else
- slideState = 0
- end if
- if mouseHold = 1 then
- if flipstate < 2 then
- flipstate = flipstate + 1
- flipLevel = 90
- end if
- else
- flipstate = 0
- end if
- if flipstate = 1 then
- newShape = [0, 0, 0, 0]
- newShape[1] = stampShape[3]
- newShape[2] = stampShape[4]
- newShape[3] = stampShape[2]
- newShape[4] = stampShape[1]
- stampShape = newShape
- end if
- if flipLevel > 0 then
- flipLevel = flipLevel - 30
- if flipLevel < 0 then
- flipLevel = 0
- end if
- end if
- testSolidity()
- simulateGravity()
- pointOver = the mouseLoc - the loc of sprite 2
- tileOver = (pointOver / 40) + 1
- if tileOver[1] > levelWidth then
- tileOver[1] = levelWidth
- end if
- if tileOver[1] < 1 then
- tileOver[1] = 1
- end if
- if fallBlockData[2][1] > tileOver[1] then
- destPoint = fallBlockData[2] + point(-1, 0)
- else
- if fallBlockData[2][1] < tileOver[1] then
- destPoint = fallBlockData[2] + point(1, 0)
- else
- destPoint = fallBlockData[2]
- end if
- end if
- if (destPoint[2] <= 10) and (destPoint[2] >= 1) then
- if solidData[destPoint[2]][destPoint[1]] = 0 then
- fallBlockData[2] = destPoint
- else
- end if
- else
- end if
- h1 = fallBlockData[3][1]
- h2 = fallBlockData[3][2]
- v1 = fallBlockData[3][3]
- v2 = fallBlockData[3][4]
- blockSolidify = 0
- if slideState = 1 then
- destPoint = fallBlockData[2] + point(0, 1)
- if destPoint[2] <= 10 then
- if solidData[destPoint[2]][destPoint[1]] = 0 then
- fallBlockData[2] = fallBlockData[2] + point(0, 1)
- fallBlockData[4] = 0
- else
- blockSolidify = 1
- end if
- else
- blockSolidify = 1
- end if
- else
- if fallBlockData[4] <= 0 then
- destPoint = fallBlockData[2] + point(0, 1)
- if destPoint[2] <= 10 then
- if solidData[destPoint[2]][destPoint[1]] = 0 then
- fallBlockData[2] = fallBlockData[2] + point(0, 1)
- fallBlockData[4] = fallBlockData[4] + 40
- else
- blockSolidify = 1
- end if
- else
- blockSolidify = 1
- end if
- else
- end if
- end if
- fallSpeed = (playerScore / 150) + 1
- gravityForce = gravityForce + fallSpeed
- repeat while gravityForce > 1
- gravityForce = gravityForce - 1
- fallBlockData[4] = fallBlockData[4] - 1
- end repeat
- if blockSolidify = 1 then
- slideState = 2
- tileClicked = fallBlockData[2]
- if tileClicked[2] > 0 then
- if stampShape = [3, 3, 3, 3] then
- if tileClicked[2] <= 9 then
- repeat with whichYBlast = tileClicked[2] to 10
- horizontalAData[whichYBlast][tileClicked[1]] = 0
- horizontalBData[whichYBlast][tileClicked[1]] = 0
- verticalAData[whichYBlast][tileClicked[1]] = 0
- verticalBData[whichYBlast][tileClicked[1]] = 0
- end repeat
- end if
- playSound("Bomb", 2)
- else
- if stampShape = [2, 2, 2, 2] then
- if tileClicked[2] <= 9 then
- horizontalAData[tileClicked[2] + 1][tileClicked[1]] = 0
- horizontalBData[tileClicked[2] + 1][tileClicked[1]] = 0
- verticalAData[tileClicked[2] + 1][tileClicked[1]] = 0
- verticalBData[tileClicked[2] + 1][tileClicked[1]] = 0
- end if
- playSound("Bomb", 2)
- else
- horizontalAData[tileClicked[2]][tileClicked[1]] = stampShape[1]
- horizontalBData[tileClicked[2]][tileClicked[1]] = stampShape[2]
- verticalAData[tileClicked[2]][tileClicked[1]] = stampShape[3]
- verticalBData[tileClicked[2]][tileClicked[1]] = stampShape[4]
- playSound("Drop", 2)
- end if
- end if
- fallBlockData[2][2] = 0
- fallBlockData[4] = 0
- stampShape[1] = nextStampShape[1]
- stampShape[2] = nextStampShape[2]
- stampShape[3] = nextStampShape[3]
- stampShape[4] = nextStampShape[4]
- if random(10) = 1 then
- nextStampShape[1] = 2
- nextStampShape[2] = 2
- nextStampShape[3] = 2
- nextStampShape[4] = 2
- setBlock(0, 0, 0, 0)
- set the member of sprite 245 to "Bomb Tile"
- sprite(245).visible = 1
- else
- if random(20) = 1 then
- nextStampShape[1] = 3
- nextStampShape[2] = 3
- nextStampShape[3] = 3
- nextStampShape[4] = 3
- setBlock(0, 0, 0, 0)
- set the member of sprite 245 to "Dynamite Tile"
- sprite(245).visible = 1
- else
- nextStampShape[1] = random(2) - 1
- nextStampShape[2] = random(2) - 1
- nextStampShape[3] = random(2) - 1
- nextStampShape[4] = random(2) - 1
- nextStampShape[random(4)] = 1
- setBlock(nextStampShape[1], nextStampShape[2], nextStampShape[3], nextStampShape[4])
- sprite(245).visible = 0
- end if
- end if
- else
- timeToDie = 1
- end if
- mouseHold = 0
- end if
- h1 = stampShape[1]
- h2 = stampShape[2]
- v1 = stampShape[3]
- v2 = stampShape[4]
- bitData = translateSet(h1, h2, v1, v2)
- picList = ["Single", "corner", "Parallel", "Arch", "Crossway", "Empty", "error", "bomb", "Dynamite"]
- set the member of sprite 9 to picList[bitData[2]] & " tile"
- sprite(9).rotation = bitData[3] - flipLevel
- sprite(3).rotation = bitData[3] - flipLevel
- set the loc of sprite 9 to point(fallBlockData[2][1] * 40, (fallBlockData[2][2] * 40) - fallBlockData[4]) + the loc of sprite 2 - 20
- set the loc of sprite 3 to point(fallBlockData[2][1] * 40, (fallBlockData[2][2] * 40) - fallBlockData[4]) + the loc of sprite 2 - 20
- set the blend of sprite 3 to 100
- wSprite = 10
- repeat with wY = 1 to 10
- repeat with wX = 1 to levelWidth
- h1 = horizontalAData[wY][wX]
- h2 = horizontalBData[wY][wX]
- v1 = verticalAData[wY][wX]
- v2 = verticalBData[wY][wX]
- bitData = translateSet(h1, h2, v1, v2)
- picList = ["Single", "corner", "Parallel", "Arch", "Crossway", "Empty", "error", "Bomb", "Dynamite"]
- if bitData[2] = 6 then
- sprite(wSprite).visible = 0
- else
- set the member of sprite wSprite to picList[bitData[2]] & " tile"
- sprite(wSprite).visible = 1
- end if
- sprite(wSprite).rotation = bitData[3]
- wSprite = wSprite + 1
- end repeat
- end repeat
- scanConnections()
- if timeToDie = 1 then
- if playerScore > 500 then
- go(15)
- else
- go(20)
- end if
- else
- go(the frame)
- end if
- end
-