#include "main.h" #define MAX_POWER 10 typedef struct{ int x; int y; int type; int power; int radius; } t_epicenter; // variables t_epicenter* l_epicenters; int size_epicenters; int cpt_epicenter = 0; int width, height; // functions int distance_manhattan(int x1,int y1, int x2, int y2); int absolute(int val); void create_epicenter(int type); int generate(int x, int y); void create_map(t_pixel** map, t_team* teams, int w, int h){ int i,j,k,l; int type; //epicenter variable int nb_rock, nb_tree, nb_berries; //spawn variable int x_rand, y_rand; width = w; height = h; //Epicenters generation // random choice for numbers of epicenters nb_rock = rand()%5; nb_tree = rand()%5; nb_berries = rand()%5; size_epicenters = nb_rock + nb_tree + nb_berries + NB_TEAMS; l_epicenters = malloc(sizeof(t_epicenter)*size_epicenters); //plains generation for each player => after spawn for(i=0;i 0 ? val : -val; }