scene_loader.c
void StartProjectileAnimation(SceneData* scene_data){
	// Load projectile and tank then fill data to projectile in scene_data
	Projectile* projectile = &(scene_data[SCENE_GAME_MAP].projectile);
	Tank* tank = scene_data[SCENE_GAME_MAP].active_tank;
	
	projectile->type = tank->chosen_projectile; // Copy current weapon data
	projectile->to_explode = false; // Dont explode yet
	projectile->exploded = false;
	projectile->explosion_current_frames = 0; // Animation frame -> 0
	
	// Calculate copy and set animation path data
	RefreshAimPath(scene_data, false, true); // Calculate priva path data
	projectile->parabola = scene_data[SCENE_GAME_MAP].aim_path_private;
	projectile->projectile_path_pairs_index = 0; // Where are we in the animation path
	
	// Start animation
	scene_data[SCENE_GAME_MAP].animating = true;
	
	printf("Projectile animation activated!\n");
	
	return;
}
/*  This function will initialize default state for the projectile and starts animation.  */
This function will initialize default state for the projectile and starts animation.
This function will initialize default state for the projectile and starts animation .
void StartProjectileAnimation(SceneData* scene_data){
	Projectile* projectile = &(scene_data[SCENE_GAME_MAP].projectile);
	Tank* tank = scene_data[SCENE_GAME_MAP].active_tank;
	projectile->type = tank->chosen_projectile; 
	projectile->to_explode = false; 
	projectile->exploded = false;
	projectile->explosion_current_frames = 0; 
	RefreshAimPath(scene_data, false, true); 
	projectile->parabola = scene_data[SCENE_GAME_MAP].aim_path_private;
	projectile->projectile_path_pairs_index = 0; 
	scene_data[SCENE_GAME_MAP].animating = true;
	printf("Projectile animation activated!\n");
	return;
}
void StartProjectileAnimation ( SceneData * scene_data ) { Projectile * projectile = & ( scene_data [ SCENE_GAME_MAP ] . projectile ) ; Tank * tank = scene_data [ SCENE_GAME_MAP ] . active_tank ; projectile -> type = tank -> chosen_projectile ; projectile -> to_explode = false ; projectile -> exploded = false ; projectile -> explosion_current_frames = 0 ; RefreshAimPath ( scene_data , false , true ) ; projectile -> parabola = scene_data [ SCENE_GAME_MAP ] . aim_path_private ; projectile -> projectile_path_pairs_index = 0 ; scene_data [ SCENE_GAME_MAP ] . animating = true ; printf ( " \n " ) ; return ; }
This function will initialize default state for the projectile and starts animation.
This function will initialize default state for the projectile and starts animation .
// Load projectile and tank then fill data to projectile in scene_data // Copy current weapon data // Dont explode yet // Animation frame -> 0 // Calculate copy and set animation path data // Calculate priva path data // Where are we in the animation path // Start animation