home *** CD-ROM | disk | FTP | other *** search
/ 100 Plus Great Games 2 / 100PLUSV2.BIN / games / EntertheTroy.dxr / 00011.ls < prev    next >
Encoding:
Text File  |  2002-01-31  |  1.8 KB  |  53 lines

  1. on exitFrame me
  2.   global inputString, screenDimensions, playerSO, playerLocData, editmode, playerViewpoint, screenTileSize, terrainData_Type, textureBrush, mouseinput, locksOpened, maxLocks, lockedOffReigon, paletteScroll, scrollLeft, scrollRight, terrainRef
  3.   harvestinput()
  4.   repeat with wVector = 1 to 2
  5.     if inputString[[1, 4][wVector]] = 1 then
  6.       playerViewpoint[wVector] = playerViewpoint[wVector] - 20
  7.       if playerViewpoint[wVector] <= 0 then
  8.         playerViewpoint[wVector] = 1
  9.       end if
  10.       next repeat
  11.     end if
  12.     if inputString[[2, 3][wVector]] = 1 then
  13.       playerViewpoint[wVector] = playerViewpoint[wVector] + 20
  14.       maxValue = (([count(terrainData_Type[1]), count(terrainData_Type)][wVector] - screenDimensions[wVector] + 1) * 50) - 15
  15.       if playerViewpoint[wVector] > maxValue then
  16.         playerViewpoint[wVector] = maxValue
  17.       end if
  18.     end if
  19.   end repeat
  20.   if mouseinput = 1 then
  21.     editmode = #Terrain
  22.     case editmode of
  23.       #Terrain:
  24.         clickTile = ((playerViewpoint + the mouseLoc) / screenTileSize) + 1
  25.         terrainData_Type[clickTile[2]][clickTile[1]] = textureBrush
  26.     end case
  27.   end if
  28.   set the loc of sprite playerSO to playerLocData[3] - playerViewpoint
  29.   if locksOpened = maxLocks then
  30.     repeat with wY = lockedOffReigon[1] to lockedOffReigon[3]
  31.       repeat with wX = lockedOffReigon[2] to lockedOffReigon[4]
  32.         terrainData_Type[wY][wX][1] = 0
  33.       end repeat
  34.     end repeat
  35.     redrawTerrainPics()
  36.     locksOpened = 0
  37.   end if
  38.   if scrollRight = 1 then
  39.     if paletteScroll > 0 then
  40.       paletteScroll = paletteScroll - 1
  41.     end if
  42.   end if
  43.   if scrollLeft = 1 then
  44.     if paletteScroll < (count(terrainRef) - 10) then
  45.       paletteScroll = paletteScroll + 1
  46.     end if
  47.   end if
  48.   updatePaletteTextures()
  49.   repositionTerrain()
  50.   redrawTerrainPics()
  51.   go(the frame)
  52. end
  53.