home *** CD-ROM | disk | FTP | other *** search
/ 100 Plus Great Games 2 / 100PLUSV2.BIN / games / Tantrix.dxr / 00001_Globals.ls next >
Encoding:
Text File  |  2002-01-25  |  2.1 KB  |  70 lines

  1. global gSelectedTile, gNumTiles, gTileArray, gArrayWidth, gArrayHeight, gTileWidth, gTileHeight, gTopLeftPoint, gColorRequired, gCurrentLevel, gLevelTime, gTotalScore
  2.  
  3. on prepareMovie
  4.   gTotalScore = 0
  5.   gLevelTime = 0
  6.   gCurrentLevel = 0
  7.   gColorRequired = 0
  8.   gSelectedTile = 0
  9.   gTileArray = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]
  10.   gArrayWidth = 11
  11.   gArrayHeight = 7
  12.   gTileWidth = 42
  13.   gTileHeight = 50
  14.   gTopLeftPoint = point(35, 85)
  15. end
  16.  
  17. on myIntersection spriteRect, objectSpriteNum
  18.   colRect = intersect(spriteRect, sprite(objectSpriteNum).rect)
  19.   if colRect = rect(0, 0, 0, 0) then
  20.     return 0
  21.   end if
  22.   x1 = colRect.left - sprite(objectSpriteNum).rect.left
  23.   x2 = colRect.right - sprite(objectSpriteNum).rect.left
  24.   y1 = colRect.top - sprite(objectSpriteNum).rect.top
  25.   y2 = colRect.bottom - sprite(objectSpriteNum).rect.top
  26.   repeat with x = x1 to x2
  27.     x = x + 3
  28.     theColor = sprite(objectSpriteNum).member.image.getPixel(x, y1)
  29.     if theColor = rgb(0, 0, 0) then
  30.       return 1
  31.     end if
  32.   end repeat
  33.   repeat with x = x1 to x2
  34.     x = x + 3
  35.     theColor = sprite(objectSpriteNum).member.image.getPixel(x, y2)
  36.     if theColor = rgb(0, 0, 0) then
  37.       return 1
  38.     end if
  39.   end repeat
  40.   repeat with y = y1 to y2
  41.     y = y + 3
  42.     theColor = sprite(objectSpriteNum).member.image.getPixel(x1, y)
  43.     if theColor = rgb(0, 0, 0) then
  44.       return 1
  45.     end if
  46.   end repeat
  47.   repeat with y = y1 to y2
  48.     y = y + 3
  49.     theColor = sprite(objectSpriteNum).member.image.getPixel(x2, y)
  50.     if theColor = rgb(0, 0, 0) then
  51.       return 1
  52.     end if
  53.   end repeat
  54.   return 0
  55. end
  56.  
  57. on displayTime
  58.   if (gLevelTime / 60) < 10 then
  59.     timeCount = "0" & string(integer(gLevelTime / 60))
  60.   else
  61.     timeCount = string(integer(gLevelTime / 60))
  62.   end if
  63.   if (gLevelTime mod 60) < 10 then
  64.     timeCount = timeCount & ":" & "0" & string(gLevelTime mod 60)
  65.   else
  66.     timeCount = timeCount & ":" & string(gLevelTime mod 60)
  67.   end if
  68.   member("timedisp").text = timeCount
  69. end
  70.