home *** CD-ROM | disk | FTP | other *** search
Wrap
on exitFrame me global shadowShapeData, shadowSpinData, blankMapData, solidData, fallBlockData, mouseHold, flipstate, stampShape, nextStampShape, flipLevel, slideState, levelWidth, tileSize, playerlevel, gravityForce, stampShapeQue, stampSpinQue 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 = 0 end if else flipstate = 0 end if if flipstate = 1 then newShape = stampShape newShape[2] = [2, 3, 4, 1][stampShape[2]] 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 / tileSize) + 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] <= count(shadowShapeData)) and (destPoint[2] >= 1) then if solidData[destPoint[2]][destPoint[1]] = 0 then fallBlockData[2] = destPoint else end if else end if sShape = fallBlockData[3][1] sRotate = fallBlockData[3][2] blockSolidify = 0 if slideState = 1 then destPoint = fallBlockData[2] + point(0, 1) if destPoint[2] <= count(shadowShapeData) 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] <= count(shadowShapeData) then if solidData[destPoint[2]][destPoint[1]] = 0 then fallBlockData[2] = fallBlockData[2] + point(0, 1) fallBlockData[4] = fallBlockData[4] + tileSize else blockSolidify = 1 end if else blockSolidify = 1 end if else end if end if fallSpeed = (playerlevel / 2.0) + 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 count(shadowShapeData) = tileClicked[2] then shadowShapeData[tileClicked[2]][tileClicked[1]] = stampShape[1] shadowSpinData[tileClicked[2]][tileClicked[1]] = stampShape[2] else nextTestShape = shadowShapeData[tileClicked[2] + 1][tileClicked[1]] nextTestSpin = shadowSpinData[tileClicked[2] + 1][tileClicked[1]] if (nextTestShape = stampShape[1]) and (nextTestSpin = stampShape[2]) then shadowShapeData[tileClicked[2] + 1][tileClicked[1]] = 0 shadowSpinData[tileClicked[2] + 1][tileClicked[1]] = 0 else shadowShapeData[tileClicked[2]][tileClicked[1]] = stampShape[1] shadowSpinData[tileClicked[2]][tileClicked[1]] = stampShape[2] end if end if playSound("Drop", 2) fallBlockData[2][2] = 0 fallBlockData[4] = 0 stampShape[1] = stampShapeQue[1] stampShape[2] = stampSpinQue[1] deleteAt(stampShapeQue, 1) deleteAt(stampSpinQue, 1) addToQue() else timeToDie = 1 end if mouseHold = 0 end if sShape = stampShape[1] sSpin = stampShape[2] set the member of sprite 9 to "Shape " & string(sShape) sprite(9).rotation = (sSpin * 90) - flipLevel set the loc of sprite 9 to point(fallBlockData[2][1] * tileSize, (fallBlockData[2][2] * tileSize) - fallBlockData[4]) + the loc of sprite 2 - (tileSize / 2) wSprite = 10 repeat with wY = 1 to count(shadowShapeData) repeat with wX = 1 to levelWidth xRem = shadowShapeData[wY] hShape = shadowShapeData[wY][wX] hSpin = shadowSpinData[wY][wX] if hShape <> 0 then set the member of sprite wSprite to "Shadow " & string(hShape) sprite(wSprite).visible = 1 else sprite(wSprite).visible = 0 end if sprite(wSprite).rotation = hSpin * 90 wSprite = wSprite + 1 end repeat end repeat scanConnections() if timeToDie = 1 then go(10) else go(the frame) end if end