/*
	init - This method initializes the layer, including calculating
	the dimensions of the layer based on the sizes of the tiles and 
	the numbers of rows & columns. In addition, it calculates the parallax
	factor used for parallax scrolling.
*/
void ParallaxLayer::init(int initColumns, 
						int initRows,
						int initTileWidth, 
						int initTileHeight,
						int initZ,
						bool initCollidableTiles,
						Viewport *viewport,
						int worldWidth,
						int worldHeight)
{
	columns = initColumns;
	rows = initRows;
	tileWidth = initTileWidth;
	tileHeight = initTileHeight;
	z = initZ;
	collidableTiles = initCollidableTiles;
	tileLayout = new vector<pTile*>();
	calculateAndSetLayerWidth();
	calculateAndSetLayerHeight();
}
예제 #2
0
/*
	init - This method initializes the layer, including calculating
	the dimensions of the layer based on the sizes of the tiles and 
	the numbers of rows & columns. In addition, it calculates the parallax
	factor used for parallax scrolling.
*/
void TiledLayer::init(int initColumns, 
						int initRows,
						int initTileWidth, 
						int initTileHeight,
						int initZ,
						bool initCollidableTiles,
						int initWorldWidth,
						int initWorldHeight)
{
	columns = initColumns;
	rows = initRows;
	tileWidth = initTileWidth;
	tileHeight = initTileHeight;
	worldWidth = initWorldWidth;
	worldHeight = initWorldHeight;
	z = initZ;
	collidableTiles = initCollidableTiles;
	tileLayout = new vector<Tile*>();
	calculateAndSetLayerWidth();
	calculateAndSetLayerHeight();
}