home *** CD-ROM | disk | FTP | other *** search
- on exitFrame me
- global inputString, screenDimensions, playerSO, playerLocData, editmode, playerViewpoint, screenTileSize, terrainData_Type, textureBrush, mouseinput, locksOpened, maxLocks, lockedOffReigon, paletteScroll, scrollLeft, scrollRight, terrainRef
- harvestinput()
- repeat with wVector = 1 to 2
- if inputString[[1, 4][wVector]] = 1 then
- playerViewpoint[wVector] = playerViewpoint[wVector] - 20
- if playerViewpoint[wVector] <= 0 then
- playerViewpoint[wVector] = 1
- end if
- next repeat
- end if
- if inputString[[2, 3][wVector]] = 1 then
- playerViewpoint[wVector] = playerViewpoint[wVector] + 20
- maxValue = (([count(terrainData_Type[1]), count(terrainData_Type)][wVector] - screenDimensions[wVector] + 1) * 50) - 15
- if playerViewpoint[wVector] > maxValue then
- playerViewpoint[wVector] = maxValue
- end if
- end if
- end repeat
- if mouseinput = 1 then
- editmode = #Terrain
- case editmode of
- #Terrain:
- clickTile = ((playerViewpoint + the mouseLoc) / screenTileSize) + 1
- terrainData_Type[clickTile[2]][clickTile[1]] = textureBrush
- end case
- end if
- set the loc of sprite playerSO to playerLocData[3] - playerViewpoint
- if locksOpened = maxLocks then
- repeat with wY = lockedOffReigon[1] to lockedOffReigon[3]
- repeat with wX = lockedOffReigon[2] to lockedOffReigon[4]
- terrainData_Type[wY][wX][1] = 0
- end repeat
- end repeat
- redrawTerrainPics()
- locksOpened = 0
- end if
- if scrollRight = 1 then
- if paletteScroll > 0 then
- paletteScroll = paletteScroll - 1
- end if
- end if
- if scrollLeft = 1 then
- if paletteScroll < (count(terrainRef) - 10) then
- paletteScroll = paletteScroll + 1
- end if
- end if
- updatePaletteTextures()
- repositionTerrain()
- redrawTerrainPics()
- go(the frame)
- end
-