GreenJuiceTeam/GreenJuiceTeam.Shared/game/Block.cpp
/**
* Paints the block on the screen
* @param g
* @param objs
*/
Paints the block on the screen
Paints the block on the screen
void Block::paint(const std::vector<Enemy*>& enemies,bool isPaused){
	if(paint_){
		polygon->paint(color,true,isPaintStartLine(),next != NULL);
		if(drawLine){
			lines->paint(LINE_COLOR, linesPoints[BOTTOM_RIGHT][X] - linesPoints[BOTTOM_LEFT][X] > 0,false,true);
		}
	}
	spriteBatchDraw(400, 280, GL2D_CENTER, Util::textures[Util::SHADOW],false,0,10,0.5f,1,1,1,0.12f);
	if(!isPaused){
		if(player != NULL){
			player->paint();
			player = NULL;
		}	
		for (int i = 0; i < idEnemiesToPaint.size(); i++) {
			int id = idEnemiesToPaint[i];
			enemies[id]->paint();
		}
	}
}
void Block :: paint ( const std :: vector < Enemy * > & enemies , bool isPaused ) { if ( paint_ ) { polygon -> paint ( color , true , isPaintStartLine ( ) , next != NULL ) ; if ( drawLine ) { lines -> paint ( LINE_COLOR , linesPoints [ BOTTOM_RIGHT ] [ X ] - linesPoints [ BOTTOM_LEFT ] [ X ] > 0 , false , true ) ; } } spriteBatchDraw ( 400 , 280 , GL2D_CENTER , Util :: textures [ Util :: SHADOW ] , false , 0 , 10 , 0.5f , 1 , 1 , 1 , 0.12f ) ; if ( ! isPaused ) { if ( player != NULL ) { player -> paint ( ) ; player = NULL ; } for ( int i = 0 ; i < idEnemiesToPaint . size ( ) ; i ++ ) { int id = idEnemiesToPaint [ i ] ; enemies [ id ] -> paint ( ) ; } } }
Paints the block on the screen
Paints the block on the screen
//Paints the road //don't draw the border is it is the last block //Paints the line //TODO: need to check the Z axis for the right print order. //draw player and enemies