scene_loader.c
void FillCanvasWithTanks(SceneData* scene_data, Canvas* game_canvas){
	// Get tank count
	int player_1_tank_count = scene_data[CURRENT_SCENE].player_1_tanks;
	int player_2_tank_count = scene_data[CURRENT_SCENE].player_2_tanks;
	
	// Transparent color for tank is
	RGB transparent_color = {.R = 254, .G = 254, .B = 254};
	// Tank height is n px
	int tank_height = 9;
	
	// Display each tank on canvas, if its alive
	for(int t = 0; t < player_1_tank_count; t++){
		int x = scene_data[CURRENT_SCENE].player_1_tanks_obj[t].x;
		int y = scene_data[CURRENT_SCENE].player_1_tanks_obj[t].y;
		
		if(scene_data[CURRENT_SCENE].player_1_tanks_obj[t].is_alive == true){ // Is the tank alive?
			Canvas2CanvasFull(&(scene_data[CURRENT_SCENE].player_1_tank), game_canvas, x, y-tank_height, true, &transparent_color);
		}
		
	}
	// Display each tank on canvas, if its alive
	for(int t = 0; t < player_2_tank_count; t++){
		int x = scene_data[CURRENT_SCENE].player_2_tanks_obj[t].x;
		int y = scene_data[CURRENT_SCENE].player_2_tanks_obj[t].y;
		
		if(scene_data[CURRENT_SCENE].player_2_tanks_obj[t].is_alive == true){ // Is the tank alive?
			Canvas2CanvasFull(&(scene_data[CURRENT_SCENE].player_2_tank), game_canvas, x, y-tank_height, true, &transparent_color);
		}
		
	}
	return;
}
// Add tank images to canvas 'game_canvas'
Add tank images to canvas 'game_canvas'
Add tank images to canvas ' game_canvas '
void FillCanvasWithTanks(SceneData* scene_data, Canvas* game_canvas){
	int player_1_tank_count = scene_data[CURRENT_SCENE].player_1_tanks;
	int player_2_tank_count = scene_data[CURRENT_SCENE].player_2_tanks;
	RGB transparent_color = {.R = 254, .G = 254, .B = 254};
	int tank_height = 9;
	for(int t = 0; t < player_1_tank_count; t++){
		int x = scene_data[CURRENT_SCENE].player_1_tanks_obj[t].x;
		int y = scene_data[CURRENT_SCENE].player_1_tanks_obj[t].y;
		if(scene_data[CURRENT_SCENE].player_1_tanks_obj[t].is_alive == true){ 
			Canvas2CanvasFull(&(scene_data[CURRENT_SCENE].player_1_tank), game_canvas, x, y-tank_height, true, &transparent_color);
		}
	}
	for(int t = 0; t < player_2_tank_count; t++){
		int x = scene_data[CURRENT_SCENE].player_2_tanks_obj[t].x;
		int y = scene_data[CURRENT_SCENE].player_2_tanks_obj[t].y;
		if(scene_data[CURRENT_SCENE].player_2_tanks_obj[t].is_alive == true){ 
			Canvas2CanvasFull(&(scene_data[CURRENT_SCENE].player_2_tank), game_canvas, x, y-tank_height, true, &transparent_color);
		}
	}
	return;
}
void FillCanvasWithTanks ( SceneData * scene_data , Canvas * game_canvas ) { int player_1_tank_count = scene_data [ CURRENT_SCENE ] . player_1_tanks ; int player_2_tank_count = scene_data [ CURRENT_SCENE ] . player_2_tanks ; RGB transparent_color = { . R = 254 , . G = 254 , . B = 254 } ; int tank_height = 9 ; for ( int t = 0 ; t < player_1_tank_count ; t ++ ) { int x = scene_data [ CURRENT_SCENE ] . player_1_tanks_obj [ t ] . x ; int y = scene_data [ CURRENT_SCENE ] . player_1_tanks_obj [ t ] . y ; if ( scene_data [ CURRENT_SCENE ] . player_1_tanks_obj [ t ] . is_alive == true ) { Canvas2CanvasFull ( & ( scene_data [ CURRENT_SCENE ] . player_1_tank ) , game_canvas , x , y - tank_height , true , & transparent_color ) ; } } for ( int t = 0 ; t < player_2_tank_count ; t ++ ) { int x = scene_data [ CURRENT_SCENE ] . player_2_tanks_obj [ t ] . x ; int y = scene_data [ CURRENT_SCENE ] . player_2_tanks_obj [ t ] . y ; if ( scene_data [ CURRENT_SCENE ] . player_2_tanks_obj [ t ] . is_alive == true ) { Canvas2CanvasFull ( & ( scene_data [ CURRENT_SCENE ] . player_2_tank ) , game_canvas , x , y - tank_height , true , & transparent_color ) ; } } return ; }
Add tank images to canvas 'game_canvas'
Add tank images to canvas ' game_canvas '
// Get tank count // Transparent color for tank is // Tank height is n px // Display each tank on canvas, if its alive // Is the tank alive? // Display each tank on canvas, if its alive // Is the tank alive?