
map.offX = 32
map.offY = 32
map.gridSize = 32

pgMap = { }

function pgMap:init( )
	mGrid:init( )

	self._initShake = false
	self._shakeTimer = Game.worldTimer
	self._shakeInterval = 2.2

	self._rightOffsetMax = { }
	self._rightOffsetMax[1] = { x = 608, y = 352 }
	self._rightOffsetMax[2] = { x = 268, y = 128 }
	self._rightOffsetMax[3] = { x = 148, y = 128 }

	self._corner = {}

	self._baseTable = {}
	self._mainGrid = 0
	self._buildingGrid = 1
	self._collisionGridDebug = 2

	self._tileSize = 32

	self._mapSizeX = 20
	self._mapSizeY = 11

	self._deckIndex = 1 -- level deck

	self._tileMovementCost = 1

	self._globalMapScroll = false
	map.targetLocX = map.offX
	map.targetLocY = map.offY
	map.oldX = map.offX
	map.oldY = map.offY

	self._mapScrollDelay = 0.9
	self._startDelay = false

	self._scrollVarRes = { }
	self._scrollVarRes[1] = { x = -224, y = 108 }
	self._scrollVarRes[2] = { x = 256, y = 128 }
	self._scrollVarRes[3] = { x = 512, y = 255 }


	self._teamToPlayer = {} -- basically, calls player1 or 2 based on turn
	self._teamToPlayer[1] = player1
	self._teamToPlayer[2] = player2

	self._mapGrid = mGrid:new(self._mapSizeX, self._mapSizeY, self._tileSize, "Game/media/tileset_ground.png", 9)
end

function pgMap:setTile(_x, _y)
	 mGrid:setTiles3(self._mapGrid, _x, _y, 1)
end

function pgMap:loop( )


end

function pgMap:update( )
	mGrid:setPos(self._mapGrid,  map.offX,  map.offY  )
	self:loop( )
	
end

function pgMap:setScreen(_x, _y)
	map.offX = map.offX + _x
	map.offY = map.offY + _y 
end
