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

  1. on exitFrame me
  2.   global shadowShapeData, shadowSpinData, blankMapData, solidData, fallBlockData, mouseHold, flipstate, stampShape, nextStampShape, flipLevel, slideState, levelWidth, tileSize, playerlevel, gravityForce, stampShapeQue, stampSpinQue
  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 = 0
  14.     end if
  15.   else
  16.     flipstate = 0
  17.   end if
  18.   if flipstate = 1 then
  19.     newShape = stampShape
  20.     newShape[2] = [2, 3, 4, 1][stampShape[2]]
  21.     stampShape = newShape
  22.   end if
  23.   if flipLevel > 0 then
  24.     flipLevel = flipLevel - 30
  25.     if flipLevel < 0 then
  26.       flipLevel = 0
  27.     end if
  28.   end if
  29.   testSolidity()
  30.   simulateGravity()
  31.   pointOver = the mouseLoc - the loc of sprite 2
  32.   tileOver = (pointOver / tileSize) + 1
  33.   if tileOver[1] > levelWidth then
  34.     tileOver[1] = levelWidth
  35.   end if
  36.   if tileOver[1] < 1 then
  37.     tileOver[1] = 1
  38.   end if
  39.   if fallBlockData[2][1] > tileOver[1] then
  40.     destPoint = fallBlockData[2] + point(-1, 0)
  41.   else
  42.     if fallBlockData[2][1] < tileOver[1] then
  43.       destPoint = fallBlockData[2] + point(1, 0)
  44.     else
  45.       destPoint = fallBlockData[2]
  46.     end if
  47.   end if
  48.   if (destPoint[2] <= count(shadowShapeData)) and (destPoint[2] >= 1) then
  49.     if solidData[destPoint[2]][destPoint[1]] = 0 then
  50.       fallBlockData[2] = destPoint
  51.     else
  52.     end if
  53.   else
  54.   end if
  55.   sShape = fallBlockData[3][1]
  56.   sRotate = fallBlockData[3][2]
  57.   blockSolidify = 0
  58.   if slideState = 1 then
  59.     destPoint = fallBlockData[2] + point(0, 1)
  60.     if destPoint[2] <= count(shadowShapeData) then
  61.       if solidData[destPoint[2]][destPoint[1]] = 0 then
  62.         fallBlockData[2] = fallBlockData[2] + point(0, 1)
  63.         fallBlockData[4] = 0
  64.       else
  65.         blockSolidify = 1
  66.       end if
  67.     else
  68.       blockSolidify = 1
  69.     end if
  70.   else
  71.     if fallBlockData[4] <= 0 then
  72.       destPoint = fallBlockData[2] + point(0, 1)
  73.       if destPoint[2] <= count(shadowShapeData) then
  74.         if solidData[destPoint[2]][destPoint[1]] = 0 then
  75.           fallBlockData[2] = fallBlockData[2] + point(0, 1)
  76.           fallBlockData[4] = fallBlockData[4] + tileSize
  77.         else
  78.           blockSolidify = 1
  79.         end if
  80.       else
  81.         blockSolidify = 1
  82.       end if
  83.     else
  84.     end if
  85.   end if
  86.   fallSpeed = (playerlevel / 2.0) + 1
  87.   gravityForce = gravityForce + fallSpeed
  88.   repeat while gravityForce > 1
  89.     gravityForce = gravityForce - 1
  90.     fallBlockData[4] = fallBlockData[4] - 1
  91.   end repeat
  92.   if blockSolidify = 1 then
  93.     slideState = 2
  94.     tileClicked = fallBlockData[2]
  95.     if tileClicked[2] > 0 then
  96.       if count(shadowShapeData) = tileClicked[2] then
  97.         shadowShapeData[tileClicked[2]][tileClicked[1]] = stampShape[1]
  98.         shadowSpinData[tileClicked[2]][tileClicked[1]] = stampShape[2]
  99.       else
  100.         nextTestShape = shadowShapeData[tileClicked[2] + 1][tileClicked[1]]
  101.         nextTestSpin = shadowSpinData[tileClicked[2] + 1][tileClicked[1]]
  102.         if (nextTestShape = stampShape[1]) and (nextTestSpin = stampShape[2]) then
  103.           shadowShapeData[tileClicked[2] + 1][tileClicked[1]] = 0
  104.           shadowSpinData[tileClicked[2] + 1][tileClicked[1]] = 0
  105.         else
  106.           shadowShapeData[tileClicked[2]][tileClicked[1]] = stampShape[1]
  107.           shadowSpinData[tileClicked[2]][tileClicked[1]] = stampShape[2]
  108.         end if
  109.       end if
  110.       playSound("Drop", 2)
  111.       fallBlockData[2][2] = 0
  112.       fallBlockData[4] = 0
  113.       stampShape[1] = stampShapeQue[1]
  114.       stampShape[2] = stampSpinQue[1]
  115.       deleteAt(stampShapeQue, 1)
  116.       deleteAt(stampSpinQue, 1)
  117.       addToQue()
  118.     else
  119.       timeToDie = 1
  120.     end if
  121.     mouseHold = 0
  122.   end if
  123.   sShape = stampShape[1]
  124.   sSpin = stampShape[2]
  125.   set the member of sprite 9 to "Shape " & string(sShape)
  126.   sprite(9).rotation = (sSpin * 90) - flipLevel
  127.   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)
  128.   wSprite = 10
  129.   repeat with wY = 1 to count(shadowShapeData)
  130.     repeat with wX = 1 to levelWidth
  131.       xRem = shadowShapeData[wY]
  132.       hShape = shadowShapeData[wY][wX]
  133.       hSpin = shadowSpinData[wY][wX]
  134.       if hShape <> 0 then
  135.         set the member of sprite wSprite to "Shadow " & string(hShape)
  136.         sprite(wSprite).visible = 1
  137.       else
  138.         sprite(wSprite).visible = 0
  139.       end if
  140.       sprite(wSprite).rotation = hSpin * 90
  141.       wSprite = wSprite + 1
  142.     end repeat
  143.   end repeat
  144.   scanConnections()
  145.   if timeToDie = 1 then
  146.     go(10)
  147.   else
  148.     go(the frame)
  149.   end if
  150. end
  151.