home *** CD-ROM | disk | FTP | other *** search
/ 100 Plus Great Games 2 / 100PLUSV2.BIN / games / RowsAndColumns.dxr / 00003.ls < prev    next >
Encoding:
Text File  |  2002-01-25  |  6.5 KB  |  208 lines

  1. on exitFrame me
  2.   global verticalAData, verticalBData, horizontalAData, horizontalBData, blankMapData, solidData, fallBlockData, mouseHold, flipstate, stampShape, nextStampShape, flipLevel, slideState, levelWidth, playerScore, gravityForce
  3.   if keyPressed(49) = 1 then
  4.     if slideState < 1 then
  5.       slideState = slideState + 1
  6.     end if
  7.   else
  8.     slideState = 0
  9.   end if
  10.   if mouseHold = 1 then
  11.     if flipstate < 2 then
  12.       flipstate = flipstate + 1
  13.       flipLevel = 90
  14.     end if
  15.   else
  16.     flipstate = 0
  17.   end if
  18.   if flipstate = 1 then
  19.     newShape = [0, 0, 0, 0]
  20.     newShape[1] = stampShape[3]
  21.     newShape[2] = stampShape[4]
  22.     newShape[3] = stampShape[2]
  23.     newShape[4] = stampShape[1]
  24.     stampShape = newShape
  25.   end if
  26.   if flipLevel > 0 then
  27.     flipLevel = flipLevel - 30
  28.     if flipLevel < 0 then
  29.       flipLevel = 0
  30.     end if
  31.   end if
  32.   testSolidity()
  33.   simulateGravity()
  34.   pointOver = the mouseLoc - the loc of sprite 2
  35.   tileOver = (pointOver / 40) + 1
  36.   if tileOver[1] > levelWidth then
  37.     tileOver[1] = levelWidth
  38.   end if
  39.   if tileOver[1] < 1 then
  40.     tileOver[1] = 1
  41.   end if
  42.   if fallBlockData[2][1] > tileOver[1] then
  43.     destPoint = fallBlockData[2] + point(-1, 0)
  44.   else
  45.     if fallBlockData[2][1] < tileOver[1] then
  46.       destPoint = fallBlockData[2] + point(1, 0)
  47.     else
  48.       destPoint = fallBlockData[2]
  49.     end if
  50.   end if
  51.   if (destPoint[2] <= 10) and (destPoint[2] >= 1) then
  52.     if solidData[destPoint[2]][destPoint[1]] = 0 then
  53.       fallBlockData[2] = destPoint
  54.     else
  55.     end if
  56.   else
  57.   end if
  58.   h1 = fallBlockData[3][1]
  59.   h2 = fallBlockData[3][2]
  60.   v1 = fallBlockData[3][3]
  61.   v2 = fallBlockData[3][4]
  62.   blockSolidify = 0
  63.   if slideState = 1 then
  64.     destPoint = fallBlockData[2] + point(0, 1)
  65.     if destPoint[2] <= 10 then
  66.       if solidData[destPoint[2]][destPoint[1]] = 0 then
  67.         fallBlockData[2] = fallBlockData[2] + point(0, 1)
  68.         fallBlockData[4] = 0
  69.       else
  70.         blockSolidify = 1
  71.       end if
  72.     else
  73.       blockSolidify = 1
  74.     end if
  75.   else
  76.     if fallBlockData[4] <= 0 then
  77.       destPoint = fallBlockData[2] + point(0, 1)
  78.       if destPoint[2] <= 10 then
  79.         if solidData[destPoint[2]][destPoint[1]] = 0 then
  80.           fallBlockData[2] = fallBlockData[2] + point(0, 1)
  81.           fallBlockData[4] = fallBlockData[4] + 40
  82.         else
  83.           blockSolidify = 1
  84.         end if
  85.       else
  86.         blockSolidify = 1
  87.       end if
  88.     else
  89.     end if
  90.   end if
  91.   fallSpeed = (playerScore / 150) + 1
  92.   gravityForce = gravityForce + fallSpeed
  93.   repeat while gravityForce > 1
  94.     gravityForce = gravityForce - 1
  95.     fallBlockData[4] = fallBlockData[4] - 1
  96.   end repeat
  97.   if blockSolidify = 1 then
  98.     slideState = 2
  99.     tileClicked = fallBlockData[2]
  100.     if tileClicked[2] > 0 then
  101.       if stampShape = [3, 3, 3, 3] then
  102.         if tileClicked[2] <= 9 then
  103.           repeat with whichYBlast = tileClicked[2] to 10
  104.             horizontalAData[whichYBlast][tileClicked[1]] = 0
  105.             horizontalBData[whichYBlast][tileClicked[1]] = 0
  106.             verticalAData[whichYBlast][tileClicked[1]] = 0
  107.             verticalBData[whichYBlast][tileClicked[1]] = 0
  108.           end repeat
  109.         end if
  110.         playSound("Bomb", 2)
  111.       else
  112.         if stampShape = [2, 2, 2, 2] then
  113.           if tileClicked[2] <= 9 then
  114.             horizontalAData[tileClicked[2] + 1][tileClicked[1]] = 0
  115.             horizontalBData[tileClicked[2] + 1][tileClicked[1]] = 0
  116.             verticalAData[tileClicked[2] + 1][tileClicked[1]] = 0
  117.             verticalBData[tileClicked[2] + 1][tileClicked[1]] = 0
  118.           end if
  119.           playSound("Bomb", 2)
  120.         else
  121.           horizontalAData[tileClicked[2]][tileClicked[1]] = stampShape[1]
  122.           horizontalBData[tileClicked[2]][tileClicked[1]] = stampShape[2]
  123.           verticalAData[tileClicked[2]][tileClicked[1]] = stampShape[3]
  124.           verticalBData[tileClicked[2]][tileClicked[1]] = stampShape[4]
  125.           playSound("Drop", 2)
  126.         end if
  127.       end if
  128.       fallBlockData[2][2] = 0
  129.       fallBlockData[4] = 0
  130.       stampShape[1] = nextStampShape[1]
  131.       stampShape[2] = nextStampShape[2]
  132.       stampShape[3] = nextStampShape[3]
  133.       stampShape[4] = nextStampShape[4]
  134.       if random(10) = 1 then
  135.         nextStampShape[1] = 2
  136.         nextStampShape[2] = 2
  137.         nextStampShape[3] = 2
  138.         nextStampShape[4] = 2
  139.         setBlock(0, 0, 0, 0)
  140.         set the member of sprite 245 to "Bomb Tile"
  141.         sprite(245).visible = 1
  142.       else
  143.         if random(20) = 1 then
  144.           nextStampShape[1] = 3
  145.           nextStampShape[2] = 3
  146.           nextStampShape[3] = 3
  147.           nextStampShape[4] = 3
  148.           setBlock(0, 0, 0, 0)
  149.           set the member of sprite 245 to "Dynamite Tile"
  150.           sprite(245).visible = 1
  151.         else
  152.           nextStampShape[1] = random(2) - 1
  153.           nextStampShape[2] = random(2) - 1
  154.           nextStampShape[3] = random(2) - 1
  155.           nextStampShape[4] = random(2) - 1
  156.           nextStampShape[random(4)] = 1
  157.           setBlock(nextStampShape[1], nextStampShape[2], nextStampShape[3], nextStampShape[4])
  158.           sprite(245).visible = 0
  159.         end if
  160.       end if
  161.     else
  162.       timeToDie = 1
  163.     end if
  164.     mouseHold = 0
  165.   end if
  166.   h1 = stampShape[1]
  167.   h2 = stampShape[2]
  168.   v1 = stampShape[3]
  169.   v2 = stampShape[4]
  170.   bitData = translateSet(h1, h2, v1, v2)
  171.   picList = ["Single", "corner", "Parallel", "Arch", "Crossway", "Empty", "error", "bomb", "Dynamite"]
  172.   set the member of sprite 9 to picList[bitData[2]] & " tile"
  173.   sprite(9).rotation = bitData[3] - flipLevel
  174.   sprite(3).rotation = bitData[3] - flipLevel
  175.   set the loc of sprite 9 to point(fallBlockData[2][1] * 40, (fallBlockData[2][2] * 40) - fallBlockData[4]) + the loc of sprite 2 - 20
  176.   set the loc of sprite 3 to point(fallBlockData[2][1] * 40, (fallBlockData[2][2] * 40) - fallBlockData[4]) + the loc of sprite 2 - 20
  177.   set the blend of sprite 3 to 100
  178.   wSprite = 10
  179.   repeat with wY = 1 to 10
  180.     repeat with wX = 1 to levelWidth
  181.       h1 = horizontalAData[wY][wX]
  182.       h2 = horizontalBData[wY][wX]
  183.       v1 = verticalAData[wY][wX]
  184.       v2 = verticalBData[wY][wX]
  185.       bitData = translateSet(h1, h2, v1, v2)
  186.       picList = ["Single", "corner", "Parallel", "Arch", "Crossway", "Empty", "error", "Bomb", "Dynamite"]
  187.       if bitData[2] = 6 then
  188.         sprite(wSprite).visible = 0
  189.       else
  190.         set the member of sprite wSprite to picList[bitData[2]] & " tile"
  191.         sprite(wSprite).visible = 1
  192.       end if
  193.       sprite(wSprite).rotation = bitData[3]
  194.       wSprite = wSprite + 1
  195.     end repeat
  196.   end repeat
  197.   scanConnections()
  198.   if timeToDie = 1 then
  199.     if playerScore > 500 then
  200.       go(15)
  201.     else
  202.       go(20)
  203.     end if
  204.   else
  205.     go(the frame)
  206.   end if
  207. end
  208.