GreenJuiceTeam/GreenJuiceTeam.Shared/game/Block.cpp
/**
* Updates the angle of the block
* @param pos - the position of the block in the array
*/
Updates the angle of the block
Updates the angle of the block
void Block::updateAngle(int pos){
	int ref = Road::CAR_BLOCK;
	if(pos == ref){
		accumulatedAngle = (angle * (view[Z]%BLOCK_LENGTH))/BLOCK_LENGTH;
		position[X] = accumulatedAngle;
	} else if(pos > ref){
		accumulatedAngle = previous->accumulatedAngle + angle;
		position[X] = previous->position[X] + accumulatedAngle;
	} else {
		position[X] = 0;
	}
}
void Block :: updateAngle ( int pos ) { int ref = Road :: CAR_BLOCK ; if ( pos == ref ) { accumulatedAngle = ( angle * ( view [ Z ] % BLOCK_LENGTH ) ) / BLOCK_LENGTH ; position [ X ] = accumulatedAngle ; } else if ( pos > ref ) { accumulatedAngle = previous -> accumulatedAngle + angle ; position [ X ] = previous -> position [ X ] + accumulatedAngle ; } else { position [ X ] = 0 ; } }
Updates the angle of the block
Updates the angle of the block
//System.out.println("update:" + id + "-" + position[X]); //TODO