scene_loader.c
void RefreshProjectileGroundDistance(SceneData* scene_data){
	// Load projectile and get the x and y coordinates
	Projectile* projectile = &(scene_data[SCENE_GAME_MAP].projectile);
	int aim_path_index = projectile->projectile_path_pairs_index;
	Parabola* projectile_parabola = projectile->parabola;
	
	int projectile_x = projectile_parabola->parabolic_path[aim_path_index*2];
	int projectile_y = projectile_parabola->parabolic_path[aim_path_index*2 + 1];
	//////////////////////////////////////////////////		
	
	/* We will use the x index of parabola to get the y information about the
	   height from array map  */
	int ground_distance = projectile_y - (DISPLAY_HEIGHT - scene_data[SCENE_GAME_MAP].game_map_array[projectile_x]);
	
	printf("Distance from the ground is: %d\n", ground_distance);
	// Save the height info to projectile
	projectile->distance_from_ground = ground_distance;
	
	return;
}
/*  This function calculates immediate distance of projectile from the ground  */
This function calculates immediate distance of projectile from the ground
This function calculates immediate distance of projectile from the ground
void RefreshProjectileGroundDistance(SceneData* scene_data){
	Projectile* projectile = &(scene_data[SCENE_GAME_MAP].projectile);
	int aim_path_index = projectile->projectile_path_pairs_index;
	Parabola* projectile_parabola = projectile->parabola;
	int projectile_x = projectile_parabola->parabolic_path[aim_path_index*2];
	int projectile_y = projectile_parabola->parabolic_path[aim_path_index*2 + 1];
	int ground_distance = projectile_y - (DISPLAY_HEIGHT - scene_data[SCENE_GAME_MAP].game_map_array[projectile_x]);
	printf("Distance from the ground is: %d\n", ground_distance);
	projectile->distance_from_ground = ground_distance;
	return;
}
void RefreshProjectileGroundDistance ( SceneData * scene_data ) { Projectile * projectile = & ( scene_data [ SCENE_GAME_MAP ] . projectile ) ; int aim_path_index = projectile -> projectile_path_pairs_index ; Parabola * projectile_parabola = projectile -> parabola ; int projectile_x = projectile_parabola -> parabolic_path [ aim_path_index * 2 ] ; int projectile_y = projectile_parabola -> parabolic_path [ aim_path_index * 2 + 1 ] ; int ground_distance = projectile_y - ( DISPLAY_HEIGHT - scene_data [ SCENE_GAME_MAP ] . game_map_array [ projectile_x ] ) ; printf ( " \n " , ground_distance ) ; projectile -> distance_from_ground = ground_distance ; return ; }
This function calculates immediate distance of projectile from the ground
This function calculates immediate distance of projectile from the ground
// Load projectile and get the x and y coordinates //////////////////////////////////////////////////		 /* We will use the x index of parabola to get the y information about the
	   height from array map  */ // Save the height info to projectile