scene_loader.c
void MoveBarrel(SceneData* scene_data, bool add_deg){
	// Active tank
	Tank* tank = scene_data[SCENE_GAME_MAP].active_tank;
	
	if(add_deg == true){
		if(tank->angle_of_fire >= ANGLE_OF_FIRE_MAX){
			printf("Barrel reached its maximum angle!\n");
		}else{
			// Increase barrel angle by ANGLE_OF_FIRE_STEP deg
			tank->angle_of_fire += ANGLE_OF_FIRE_STEP;
		}
	}else{
		if(tank->angle_of_fire <= ANGLE_OF_FIRE_MIN){
			printf("Barrel reached its minimum angle!\n");
		}else{
			// Decrease barrel angle by ANGLE_OF_FIRE_STEP deg
			tank->angle_of_fire -= ANGLE_OF_FIRE_STEP;
		}
	}
	printf("Barrel angle: %.2f\n", tank->angle_of_fire);
	
	return;
}
/*  This function increases current active tank barrel angle  
	if add_deg == true move barrel from 0 def to 180 deg
	else move barrel from 180 deg to 0 deg by ANGLE_OF_FIRE_STEP degree  */
This function increases current active tank barrel angle
if add_deg == true move barrel from 0 def to 180 deg
else move barrel from 180 deg to 0 deg by ANGLE_OF_FIRE_STEP degree
This function increases current active tank barrel angle if add_deg == true move barrel from 0 def to 180 deg else move barrel from 180 deg to 0 deg by ANGLE_OF_FIRE_STEP degree
void MoveBarrel(SceneData* scene_data, bool add_deg){
	Tank* tank = scene_data[SCENE_GAME_MAP].active_tank;
	if(add_deg == true){
		if(tank->angle_of_fire >= ANGLE_OF_FIRE_MAX){
			printf("Barrel reached its maximum angle!\n");
		}else{
			tank->angle_of_fire += ANGLE_OF_FIRE_STEP;
		}
	}else{
		if(tank->angle_of_fire <= ANGLE_OF_FIRE_MIN){
			printf("Barrel reached its minimum angle!\n");
		}else{
			tank->angle_of_fire -= ANGLE_OF_FIRE_STEP;
		}
	}
	printf("Barrel angle: %.2f\n", tank->angle_of_fire);
	return;
}
void MoveBarrel ( SceneData * scene_data , bool add_deg ) { Tank * tank = scene_data [ SCENE_GAME_MAP ] . active_tank ; if ( add_deg == true ) { if ( tank -> angle_of_fire >= ANGLE_OF_FIRE_MAX ) { printf ( " \n " ) ; } else { tank -> angle_of_fire += ANGLE_OF_FIRE_STEP ; } } else { if ( tank -> angle_of_fire <= ANGLE_OF_FIRE_MIN ) { printf ( " \n " ) ; } else { tank -> angle_of_fire -= ANGLE_OF_FIRE_STEP ; } } printf ( " \n " , tank -> angle_of_fire ) ; return ; }
This function increases current active tank barrel angle
if add_deg == true move barrel from 0 def to 180 deg
else move barrel from 180 deg to 0 deg by ANGLE_OF_FIRE_STEP degree
This function increases current active tank barrel angle if add_deg == true move barrel from 0 def to 180 deg else move barrel from 180 deg to 0 deg by ANGLE_OF_FIRE_STEP degree
// Active tank // Increase barrel angle by ANGLE_OF_FIRE_STEP deg // Decrease barrel angle by ANGLE_OF_FIRE_STEP deg