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

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