From 54e0925e35c87a8e6da4298280c6fd1bbf5d870e Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 21 Jun 2018 20:28:41 +0200 Subject: [PATCH] =?UTF-8?q?Ajout=20Affichage=20ar=C3=A8ne=20et=20gestion?= =?UTF-8?q?=20IA=20r=C3=A9vis=C3=A9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IAEngine.c | 64 +++++--- IAEngine.h | 3 +- adventurer_resize.png | Bin 0 -> 1881 bytes arenaEngine.c | 225 +++++++++++++++++++-------- arenaEngine.h | 18 ++- dirt_brown.png | Bin 0 -> 246 bytes fileHandler.c | 121 +++++++++++++-- fileHandler.h | 17 ++- level1-20x20.lvl | 1 + main.c | 218 ++++++++++++++++++++++---- playerInterface.c | 345 +++++++++++++++++++++++++++++++----------- playerInterface.h | 12 +- stone_resize.png | Bin 0 -> 1835 bytes tree_resize.png | Bin 0 -> 2233 bytes zombie_resize.png | Bin 0 -> 2264 bytes 15 files changed, 800 insertions(+), 224 deletions(-) create mode 100755 adventurer_resize.png create mode 100755 dirt_brown.png create mode 100644 level1-20x20.lvl create mode 100755 stone_resize.png create mode 100755 tree_resize.png create mode 100755 zombie_resize.png diff --git a/IAEngine.c b/IAEngine.c index 4be2cea..1381e23 100644 --- a/IAEngine.c +++ b/IAEngine.c @@ -8,6 +8,9 @@ */ #include "playerInterface.h" +#include "arenaEngine.h" +#include "IAEngine.h" + #include "SDL2/SDL.h" #include #include @@ -15,22 +18,19 @@ -int IAEngine(PLAYER * player1, PLAYER * player2) +int IAEngine(ARENA_H_TILE* arena,PLAYER * player1, PLAYER * player2) { - char Race[20]; - + //Fonction avec seulement 2 joueurs, voir la gestion quand il y a 2 IA supplémentaire //Player 1 est le joueur, player 2 le bot + + if((player1 != NULL) & (player2 !=NULL)) { //On récupère les positions des 2 joueurs . L'IA sait où est le joueur - int Player1PositionX = player1->PositionX; - int Player1PositionY = player1->PositionY; - int Player2PositionX = player2->PositionX; - int Player2PositionY = player2->PositionY; int action; - action = FindShortestPath(Player1PositionX,Player1PositionY,Player2PositionX,Player2PositionY); + action = FindShortestPath(player1->PositionX,player1->PositionY,player2->PositionX,player2->PositionY); printf("Tour de l'IA\n"); if(action == 5) @@ -39,40 +39,62 @@ int IAEngine(PLAYER * player1, PLAYER * player2) } else if ((action >= 1) && (action <= 4)) { - ActionPlayer(player2,action); + ActionPlayer(arena,player2,action); + } + //On vérifie si les 2 joueurs sont à côté pour attaquer + printf("Vérification position\n"); + action = FindShortestPath(player1->PositionX,player1->PositionY,player2->PositionX,player2->PositionY); + if(action == 5) + { + AttackPlayer(player2,player1); } } return 0; } + + + + + + + +//Fonction de reflexion IA fonctionne mais les pierres et arbres sont bloquants + int FindShortestPath(int Player1PositionX, int Player1PositionY, int Player2PositionX, int Player2PositionY) { + printf("Player1PositionX : %i et Player1PositionY : %i \n",Player1PositionX,Player1PositionY); + printf("Player2PositionX : %i et Player2PositionY : %i \n",Player2PositionX,Player2PositionY); int differenceX = abs(Player1PositionX - Player2PositionX); int differenceY = abs(Player1PositionY - Player2PositionY); - int action; +printf("DifferenceX : %i et DifferenceY : %i \n",differenceX,differenceY); + int action=0; - //Revoir cette partie il faut que les 2 joueurs soit sur la même ligne ou colone avec une différence de ligne ou colonne de 1 - if((abs(Player1PositionX - (Player2PositionX - 1)) == 1) || - (abs(Player1PositionX - (Player2PositionX + 1)) == 1) || - (abs(Player1PositionX - (Player2PositionY - 1)) == 1) || - (abs(Player1PositionX - (Player2PositionY + 1)) == 1)) + /*if(((differenceX == 1) && (differenceY == 0)) || ((differenceX == 0) && (differenceY == 1))) { - printf("Les 2 joueur sont à coté\n"); - printf("Le joueur 2 va combattre\n"); - action = 5; + printf("Les 2 joueur sont à coté\n"); + printf("Le joueur 2 va combattre\n"); + action = 5; + return action; + }*/ + if(((differenceX == 1) && (differenceY == 0)) || ((differenceX == 0) && (differenceY == 1))) + { + printf("Attack en cours\n"); + return action = 5; } - if(differenceX > abs(Player1PositionX - (Player2PositionX - 1))) + else if(differenceX > abs(Player1PositionX - (Player2PositionX - 1))) + //if(differenceX > abs(Player1PositionX - (Player2PositionX - 1))) { - printf("Chemin plus court sur X\n"); + printf("Chemin plus court sur X gauche\n"); printf("Le joueur 2 va vers la gauche\n"); action = 4; } else if(differenceX > abs(Player1PositionX - (Player2PositionX + 1))) { - printf("Chemin plus court sur X\n"); + printf("Chemin plus court sur X droite\n"); printf("Le joueur 2 va vers la droite\n"); action = 2; } diff --git a/IAEngine.h b/IAEngine.h index 67ec141..ebdd0e5 100644 --- a/IAEngine.h +++ b/IAEngine.h @@ -9,6 +9,7 @@ #define IAENGINE_H_ int FindShortestPath(int Player1PositionX, int Player1PositionY, int Player2PositionX, int Player2PositionY); -int IAEngine(PLAYER * player1, PLAYER * player2); +//int IAEngine(PLAYER * player1, PLAYER * player2); +int IAEngine(ARENA_H_TILE* arena,PLAYER * player1, PLAYER * player2); #endif /* IAENGINE_H_ */ diff --git a/adventurer_resize.png b/adventurer_resize.png new file mode 100755 index 0000000000000000000000000000000000000000..5c4b218e067d00d5d2204b37fe995254a44541a5 GIT binary patch literal 1881 zcmV-f2d4OmP)WFU8GbZ8()Nlj2>E@cM*00zBDL_t(o!>yOeb6dv| zhrgcp@D?ltL5eFxk)kZiwp5On#IjQ<=a5`nDIe{NPOAJjKIP(D{sNz3yA-FaLtHLJ ziYQqr*`&2`F&Tjn0gxa70uOl0Ob(zJ%ZeOP&|F{7ysv-L-P0`$uoiFLH23b_Wo>1J zt#X+l2#BJH-@N-S=gyy(!<=Ow#<*Uu&zDQ3m3w#Za(i)+KYjEO-EJ4HHA#|Sv_>04 zE}uWNQ%?m_-`V;7)hkyn{`upNSzBGD)ofynL2FGM$7rn&Y>hE|v#`LwH#W@7v19UF zK&o3?J1fh}g)ct;oQq$4K^(^bj{q2B9@!%z-1`1|zPxbZP>TF4@r6%6HGlo=Gommg z2m%0-Bza7QpDv{onM{Tc&z_VzFqHF% zW6gtVgT;Gg+U*`9f;I*)kAOIy$LQGDhXa8mKaziZG|L}9{5A8(j?iocgmHor;m+z7 zS8lA3%XsXz0>ZE#%udRp-Hov`nZeW7^E^cQ;=gfvhWXhs>Wwy6zFFqZYK754h7bPm zOI~|r2H#8ZpxR))w2h?{v&B(%8XYd(3I+$6n4HA2Y%;#hTd&T75^`ymw_bmdsi{fA zZUSN-2i(+2>Qx%B2mH3D?QVcHh);+3lrSzh7p4 z$|vjoH%q#`gzr|j$sL*HR562!w$a09u=4XVFbF_(W6|Vv8Jmz0msm1j`|Pz^#Bq%4 z`6x6NA&zBmEKSOENKoj)>o`Nx@?0LhL|htb8qo=fq%hcs7HWGf)>oHtTo2o}0byo# zo|wGi}%*dw?CAa%%@4&79v7A1-242kj~4~B_J~{u%XUyh1-{$vQ4NKTWXTO1M1+nmP)kiybUM6srihK_^Kc$UwK-?^P|!LRo!K_2XKk zqr-z31KprUFN#R}E>6m3V%TAB%w|H3(Cl>C*s34&E05McbIj>)oB7lOt%%})1!cmX7RXIw29lP5_uV(i0%sNs`hwyqk2 zt%E)^iF!1bZ&F%aBhd-Rdl5;ZpZIzjz}H!Z-QVG*GvH^Rt&YgVSutA+hOkZ;bg0)_ z1f7^%VGI#rLsbNz>eWwz+I=# #include #include "fileHandler.h" -#include "logHelper.h" +//#include "logHelper.h" /* * Arena generate functions */ -ARENA_H_TILE* createHTile(ARENA_H_TILE* prevHTile) { - ARENA_H_TILE* tile_h = NULL; - if (prevHTile == NULL) { - tile_h = calloc(1,sizeof(ARENA_H_TILE)); //Using calloc because of resetting all memory allocated to 0 - tile_h->type_id = 0; - tile_h->playerOnTile = NULL; - tile_h->nextRow = NULL; - tile_h->nextColumn = NULL; - } else if (prevHTile != NULL) { - tile_h = calloc(1,sizeof(ARENA_H_TILE)); - prevHTile->nextRow = tile_h; - tile_h->type_id = 0; - tile_h->playerOnTile = NULL; - tile_h->nextRow = NULL; - tile_h->nextColumn = NULL; - } +#define BLOC_SIZE 34 // Taille d'un bloc (carré) en pixels +#define NB_BLOCS_LARGEUR 20 +#define NB_BLOCS_HAUTEUR 20 +#define LARGEUR_FENETRE BLOC_SIZE * NB_BLOCS_LARGEUR +#define HAUTEUR_FENETRE BLOC_SIZE * NB_BLOCS_HAUTEUR - return tile_h; -} -ARENA_W_TILE* createWTile(ARENA_H_TILE* prevHTile, ARENA_W_TILE* prevWTile) { - ARENA_W_TILE* tile_w = NULL; - if (prevHTile != NULL && prevWTile == NULL) { - tile_w = calloc(1,sizeof(ARENA_W_TILE)); - prevHTile->nextColumn = tile_w; - tile_w->type_id = 0; - tile_w->playerOnTile = NULL; - tile_w->nextColumn = NULL; - - return tile_w; - } else if (prevHTile == NULL && prevWTile != NULL) { - tile_w = calloc(1,sizeof(ARENA_W_TILE)); - prevWTile->nextColumn = tile_w; - tile_w->type_id = 0; - tile_w->playerOnTile = NULL; - tile_w->nextColumn = NULL; - } - - return NULL; -} - -ARENA_H_TILE* genNewArena(int size_h, int size_w) { +ARENA_H_TILE* genNewArena(int size_h, int size_w) +{ ARENA_H_TILE* arenaOrigin = NULL; ARENA_H_TILE* TmpCursor_h = NULL; ARENA_W_TILE* TmpCursor_w = NULL; int i,j; - for(i=0;itype_id = 0; + //printf("herbe\n"); + break; + case '1': + TmpCursor_w->type_id = 1; + // printf("caillou\n"); + break; + case '2': + TmpCursor_w->type_id = 2; + //printf("arbre\n"); + break; + } if (j!=0) TmpCursor_w = TmpCursor_w->nextColumn; } @@ -81,10 +81,102 @@ ARENA_H_TILE* genNewArena(int size_h, int size_w) { + +ARENA_H_TILE* createHTile(ARENA_H_TILE* prevHTile) +{ + ARENA_H_TILE* tile_h = NULL; + + if (prevHTile == NULL) + { + tile_h = calloc(1,sizeof(ARENA_H_TILE)); //Using calloc because of resetting all memory allocated to 0 + tile_h->type_id = 0; + //tile_h->playerOnTile = NULL; + tile_h->nextRow = NULL; + tile_h->nextColumn = NULL; + } + else if (prevHTile != NULL) + { + tile_h = calloc(1,sizeof(ARENA_H_TILE)); + prevHTile->nextRow = tile_h; + tile_h->type_id = 0; + //tile_h->playerOnTile = NULL; + tile_h->nextRow = NULL; + tile_h->nextColumn = NULL; + } + + return tile_h; +} + +ARENA_W_TILE* createWTile(ARENA_H_TILE* prevHTile, ARENA_W_TILE* prevWTile) +{ + ARENA_W_TILE* tile_w = NULL; + + if (prevHTile != NULL && prevWTile == NULL) + { + tile_w = calloc(1,sizeof(ARENA_W_TILE)); + prevHTile->nextColumn = tile_w; + tile_w->type_id = 0; + //tile_w->playerOnTile = NULL; + tile_w->nextColumn = NULL; + + return tile_w; + } + else if (prevHTile == NULL && prevWTile != NULL) + { + tile_w = calloc(1,sizeof(ARENA_W_TILE)); + prevWTile->nextColumn = tile_w; + tile_w->type_id = 0; + //tile_w->playerOnTile = NULL; + tile_w->nextColumn = NULL; + } + + return NULL; +} +/* +ARENA_H_TILE* genNewArena(int size_h, int size_w) +{ + ARENA_H_TILE* arenaOrigin = NULL; + ARENA_H_TILE* TmpCursor_h = NULL; + ARENA_W_TILE* TmpCursor_w = NULL; + int i,j; + + for(i=0;inextColumn; + } + } + + return arenaOrigin; +} +*/ + + /* * Arena delete functions */ -void deleteWTile(ARENA_W_TILE* WTile) { +void deleteWTile(ARENA_W_TILE* WTile) +{ if (WTile->nextColumn != NULL) { deleteWTile(WTile->nextColumn); } @@ -92,8 +184,10 @@ void deleteWTile(ARENA_W_TILE* WTile) { free(WTile); } -void deleteHTile(ARENA_H_TILE* HTile) { - if (HTile->nextRow != NULL) { +void deleteHTile(ARENA_H_TILE* HTile) +{ + if (HTile->nextRow != NULL) + { deleteHTile(HTile->nextRow); } @@ -101,7 +195,8 @@ void deleteHTile(ARENA_H_TILE* HTile) { free(HTile); } -void deleteArena(ARENA_H_TILE* arena) { +void deleteArena(ARENA_H_TILE* arena) +{ deleteHTile(arena); } @@ -110,35 +205,45 @@ void deleteArena(ARENA_H_TILE* arena) { /* * Arena status functions */ -int getTileTypeID(ARENA_H_TILE* arena, int coord_x, int coord_y) { +int getTileTypeID(ARENA_H_TILE* arena, int coord_x, int coord_y) +{ int type_id = -1; int i; - if (coord_y == 0) { + if (coord_y == 0) + { ARENA_H_TILE* tile_h = NULL; tile_h = arena; - if (coord_x != 0) { - for (i=0;inextRow; } } type_id = tile_h->type_id; - } else { + } + else + { ARENA_W_TILE* tile_w = NULL; ARENA_H_TILE* tile_h = NULL; tile_h = arena; - if (coord_x != 0) { - for (i=0;inextRow; } } tile_w = tile_h->nextColumn; - if (coord_y != 0) { - for (i=0;inextColumn; } } diff --git a/arenaEngine.h b/arenaEngine.h index 972bcaf..83671a4 100644 --- a/arenaEngine.h +++ b/arenaEngine.h @@ -1,4 +1,4 @@ -#include "playerInterface.h" +//#include "playerInterface.h" #ifndef ARENAENGINE_H_ #define ARENAENGINE_H_ @@ -15,23 +15,26 @@ typedef struct items{ }ITEMS; */ -typedef struct tileType{ +typedef struct tileType +{ int type_id; //texture? int isGround; int canBeMined; }TILE; -typedef struct arena_h_tile{ //Rows chained list +typedef struct arena_h_tile +{ //Rows chained list int type_id; - PLAYER* playerOnTile; + //PLAYER* playerOnTile; struct arena_h_tile *nextRow; struct arena_w_tile *nextColumn; }ARENA_H_TILE; -typedef struct arena_w_tile{ //Columns chained list +typedef struct arena_w_tile +{ //Columns chained list int type_id; - PLAYER* playerOnTile; + //PLAYER* playerOnTile; struct arena_w_tile *nextColumn; }ARENA_W_TILE; @@ -40,6 +43,9 @@ typedef struct arena_w_tile{ //Columns chained list ARENA_H_TILE* genNewArena(int size_h, int size_w); void deleteArena(ARENA_H_TILE* arena); +ARENA_H_TILE* createHTile(ARENA_H_TILE* prevHTile); +ARENA_W_TILE* createWTile(ARENA_H_TILE* prevHTile, ARENA_W_TILE* prevWTile); + //Status functions int getTileTypeID(ARENA_H_TILE* arena, int coord_x, int coord_y); diff --git a/dirt_brown.png b/dirt_brown.png new file mode 100755 index 0000000000000000000000000000000000000000..d193ccc1fcebdd24fd4e4c1354af4a3f7bc9c199 GIT binary patch literal 246 zcmeAS@N?(olHy`uVBq!ia0vp^N+8U^1|+TAxeoy;wj^(N7l!{JxM1({$v_d#0*}aI z1_o|n5N2eUHAey{$X?><>&pI!O;|vRIe(kzOQ4W!W=KSdbAE1aYF-JD%fR4Vl$uzQ znxasiS(2gP?&%wlqL<1J6p!+BaSVw#{PxC1!3F~XX2-piG6FmDel61Cs8Iisz*`)C zu+Qme@m$sBp!d4`9Xf1*lRX_87#NvYI0O{Hj3?z2PB;s)O}N&6C~@MdAW0dfm22yl b)M} +/* + * fileHandler.c + * + * Created on: 20 juin 2018 + * Author: isen + * + * Contient la gestion des fichier et notament la récupération d'un niveau + */ + #include -#include +#include +#include "SDL2/SDL.h" +#include "SDL2/SDL_image.h" -int resOpen(char* filename, FILE* f) { - char fLoc[128]; +#include "fileHandler.h" +//#include "main.c" - strcpy(fLoc, "resources/"); - strcat(fLoc, filename); - f = fopen(fLoc, "rb"); +#define BLOC_SIZE 34 // Taille d'un bloc (carré) en pixels +#define NB_BLOCS_LARGEUR 20 +#define NB_BLOCS_HAUTEUR 20 +#define LARGEUR_FENETRE BLOC_SIZE * NB_BLOCS_LARGEUR +#define HAUTEUR_FENETRE BLOC_SIZE * NB_BLOCS_HAUTEUR +/* - if (f != NULL) return 0; +PLAYER * LoadLevel(ARENA_H_TILE *Head) +{ + printf("Fonction Chargement d'un niveau\n"); - return -1; + if(Head == NULL) + { + printf("La liste est vide\n"); + } + else + { + FILE* fichier = NULL; + char ligneFichier[NB_BLOCS_LARGEUR * NB_BLOCS_HAUTEUR + 1] = {0}; + int i = 0, j = 0; + + //Ouverture du fichier + fichier = fopen("level1.lvl", "r"); + if (fichier == NULL) + return 0; + //Lecture du fichier + fgets(ligneFichier, NB_BLOCS_LARGEUR * NB_BLOCS_HAUTEUR + 1, fichier); + + for (i = 0 ; i < NB_BLOCS_LARGEUR ; i++) + { + for (j = 0 ; j < NB_BLOCS_HAUTEUR ; j++) + { + switch (ligneFichier[(i * NB_BLOCS_LARGEUR) + j]) + { + case '0': + //Herbe + ARENA_H_TILE->Type = 0; + break; + case '1': + //Pierre + ARENA_H_TILE->Type = 1; + break; + case '2': + //Arbre + ARENA_H_TILE->Type = 2; + break; + case '3': + //Rivière + ARENA_H_TILE->Type = 3; + break; + } + Head = Head->suiv; + } + } + } } + +*/ +//Fonction a réadapter avec la liste chainée Arene + +int chargerNiveau(int niveau[][NB_BLOCS_HAUTEUR]) +{ + FILE* fichier = NULL; + char ligneFichier[NB_BLOCS_LARGEUR * NB_BLOCS_HAUTEUR + 1] = {0}; + int i = 0, j = 0; + + printf("Chargement du fichier\n"); + fichier = fopen("level1.lvl", "r"); + if (fichier == NULL) + return 0; + + fgets(ligneFichier, NB_BLOCS_LARGEUR * NB_BLOCS_HAUTEUR + 1, fichier); + + for (i = 0 ; i < NB_BLOCS_LARGEUR ; i++) + { + for (j = 0 ; j < NB_BLOCS_HAUTEUR ; j++) + { + //printf("j= %i \n",j); + switch (ligneFichier[(i * NB_BLOCS_LARGEUR) + j]) + { + case '0': + niveau[j][i] = 0; + //printf("herbe\n"); + break; + case '1': + niveau[j][i] = 1; + // printf("caillou\n"); + break; + case '2': + niveau[j][i] = 2; + //printf("arbre\n"); + break; + } + } + //printf("Ligne\n"); + } + + fclose(fichier); + return 1; +} + diff --git a/fileHandler.h b/fileHandler.h index 7dfc698..a0d5d8e 100644 --- a/fileHandler.h +++ b/fileHandler.h @@ -1,6 +1,19 @@ +/* + * fileHandler.h + * + * Created on: 20 juin 2018 + * Author: isen + */ + #ifndef FILEHANDLER_H_ #define FILEHANDLER_H_ -int resOpen(char* filename); +#define BLOC_SIZE 34 // Taille d'un bloc (carré) en pixels +#define NB_BLOCS_LARGEUR 20 +#define NB_BLOCS_HAUTEUR 20 +#define LARGEUR_FENETRE BLOC_SIZE * NB_BLOCS_LARGEUR +#define HAUTEUR_FENETRE BLOC_SIZE * NB_BLOCS_HAUTEUR -#endif +int chargerNiveau(int niveau[][NB_BLOCS_HAUTEUR]); + +#endif /* FILEHANDLER_H_ */ diff --git a/level1-20x20.lvl b/level1-20x20.lvl new file mode 100644 index 0000000..922c81c --- /dev/null +++ b/level1-20x20.lvl @@ -0,0 +1 @@ +00000000000000000000000010000220000010000000000022000000000210000022200000000022000002220000100000020000000220000000000000000000000000000000000000000000000000000000100002200000100022000022222000000000000000002200000000021000002220000000002200000222000010000002000000022000000000000000100002200000100022000022222000000000000000002200000000020000000220000000000000000000000000000000 diff --git a/main.c b/main.c index 24ccd94..57620f3 100644 --- a/main.c +++ b/main.c @@ -7,54 +7,206 @@ //#include "IAEngine.h" #include "playerInterface.h" -#include "SDL2/SDL.h" -#include -#include -#include "logHelper.h" -#include -#include -#include +#include "fileHandler.h" #include "arenaEngine.h" -#define A_HEIGHT 100 -#define A_WIDTH 100 +#include "SDL2/SDL.h" +#include "SDL2/SDL_image.h" +#include +#include -void initDisplayLib() { - if (SDL_Init(SDL_INIT_VIDEO) != 0) { - addLogCritical("Init SDL libs failed !"); +#define BLOC_SIZE 34 // Taille d'un bloc (carré) en pixels +#define NB_BLOCS_LARGEUR 20 +#define NB_BLOCS_HAUTEUR 20 +#define LARGEUR_FENETRE BLOC_SIZE * NB_BLOCS_LARGEUR +#define HAUTEUR_FENETRE BLOC_SIZE * NB_BLOCS_HAUTEUR - exit(EXIT_FAILURE); +enum {HAUT, BAS, GAUCHE, DROITE}; +enum {GRASS, ROCK, TREE,FIRSTPLAYER, IA1}; //Définit quel type de case il s'agit + +int main(void) +{ + + SDL_Init(SDL_INIT_VIDEO); + + if (SDL_Init(SDL_INIT_VIDEO) != 0 ) + { + fprintf(stdout,"Échec de l'initialisation de la SDL (%s)\n",SDL_GetError()); + return -1; } -} + else + { + int continuer = 1; + int action; -void initResources() { - //resOpen(); -} + ARENA_H_TILE* arena = NULL; //Déclaration de l'arène -int main(int argc, char *argv[]) { - ARENA_H_TILE* arena = NULL; + SDL_Surface *player[4] = {NULL}; // 4 surfaces pour 4 directions de mario + SDL_Surface *IA1[4] = {NULL}; // 4 surfaces pour 4 directions de mario + SDL_Surface *grass = NULL; + SDL_Surface *rock = NULL, *tree = NULL,*actualPlayer = NULL, *actualIA1 = NULL; + SDL_Rect position, positionJoueur; + + + + + int i = 0, j = 0; + int carte[NB_BLOCS_LARGEUR][NB_BLOCS_HAUTEUR] = {0}; + + //SDL_WM_SetIcon(IMG_Load("adventurer_resize.png"),NULL); //Définit l'icone de la fenêtre // Création de la fenêtre SDL_Window* pWindow = NULL; - pWindow = SDL_CreateWindow("Arena Survival Tournament",SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,640,480,SDL_WINDOW_SHOWN); + pWindow = SDL_CreateWindow("Arena Survival Tournament",SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,LARGEUR_FENETRE,HAUTEUR_FENETRE,SDL_WINDOW_SHOWN); - addLogInfo("Starting game..."); - initDisplayLib(); - initResources(); + //Génération de la nouvelle arène à partir du fichier + arena = genNewArena(NB_BLOCS_HAUTEUR, NB_BLOCS_LARGEUR); - addLogInfo("Creating new arena..."); - arena = genNewArena(A_HEIGHT, A_WIDTH); - if (arena == NULL) { - addLogCritical("Error with arena generator !"); - exit(EXIT_FAILURE); - } - addLogInfo("Successfully created arena."); + if (arena == NULL) + { + printf("Erreur de la génération de l'arène\n"); + } + // Chargement des sprites (décors, personnage...) + grass = IMG_Load("/home/isen/eclipse-workspace/ArenaWarSurvival/dirt_brown.png"); + rock = IMG_Load("/home/isen/eclipse-workspace/ArenaWarSurvival/stone_resize.png"); + tree = IMG_Load("/home/isen/eclipse-workspace/ArenaWarSurvival/tree_resize.png"); - deleteArena(arena); - addLogInfo("Cleared arena."); + player[BAS] = IMG_Load("adventurer_resize.png"); + IA1[BAS] = IMG_Load("zombie_resize.png"); + + actualPlayer = player[BAS]; + actualIA1 = IA1[BAS]; + + SDL_Surface* Sprites[5]= {grass,rock,tree,actualPlayer,actualIA1}; + + // Chargement du niveau pour le tableau (Phase de test) + /*if (!chargerNiveau(carte)) + { + printf("Niveau non chargé\n");// On arrête le jeu si on n'a pas pu charger le niveau + }*/ + + /* + //Cette fonction peut être utile pour rechercher un joueur ( Pour la detection) + // Recherche de la position de Mario au départ + for (i = 0 ; i < NB_BLOCS_LARGEUR ; i++) + { + for (j = 0 ; j < NB_BLOCS_HAUTEUR ; j++) + { + if (carte[i][j] == MARIO) // Si Mario se trouve à cette position + { + positionJoueur.x = i; + positionJoueur.y = j; + carte[i][j] = VIDE; + } + } + } + */ + + // Placement des objets à l'écran à la création de l'arène + drawArena(pWindow,arena,Sprites); + SDL_Event event; // Cette variable servira plus tard à gérer les événements - return EXIT_SUCCESS; + if( pWindow ) + { + SDL_UpdateWindowSurface(pWindow); //Rafaichis la fenetre + + //SDL_Delay(3000); /* Attendre trois secondes, que l'utilisateur voie la fenêtre */ + while (continuer) + { + + + action = PlayerInterface(pWindow,arena,Sprites); + + if (action == -1) + { + continuer = 0; + } + else + { + + } + + + } + //SDL_DestroyWindow(pWindow); + } + else + { + fprintf(stderr,"Erreur de création de la fenêtre: %s\n",SDL_GetError()); + } + } + + //IAEngine(); + + SDL_Quit(); + //PlayerInterface(); + + return 0; } + +int drawArena(SDL_Window* pWindow,ARENA_H_TILE* arena,SDL_Surface **Sprites) +{ + SDL_Rect position; + int ID; + for (int i = 0 ; i < NB_BLOCS_LARGEUR ; i++) + { + for (int j = 0 ; j < NB_BLOCS_HAUTEUR ; j++) + { + position.x = i * BLOC_SIZE; + position.y = j * BLOC_SIZE; + + ID = getTileTypeID( arena, i, j); + switch(ID) + { + case GRASS: + SDL_BlitSurface(Sprites[GRASS], NULL, SDL_GetWindowSurface(pWindow), &position); + + break; + case ROCK: + SDL_BlitSurface(Sprites[ROCK], NULL, SDL_GetWindowSurface(pWindow), &position); + break; + case TREE: + SDL_BlitSurface(Sprites[TREE], NULL, SDL_GetWindowSurface(pWindow), &position); + break; + + } + } + } +} + + +/*//Fonction draw avec un tableau. A servi de test pour le graphique +int drawArena(SDL_Window* pWindow,int carte[NB_BLOCS_LARGEUR][NB_BLOCS_HAUTEUR],SDL_Surface **Sprites) +{ + SDL_Rect position; + for (int i = 0 ; i < NB_BLOCS_LARGEUR ; i++) + { + for (int j = 0 ; j < NB_BLOCS_HAUTEUR ; j++) + { + position.x = i * BLOC_SIZE; + position.y = j * BLOC_SIZE; + + + switch(carte[i][j]) + { + case GRASS: + SDL_BlitSurface(Sprites[GRASS], NULL, SDL_GetWindowSurface(pWindow), &position); + + break; + case ROCK: + SDL_BlitSurface(Sprites[ROCK], NULL, SDL_GetWindowSurface(pWindow), &position); + break; + case TREE: + SDL_BlitSurface(Sprites[TREE], NULL, SDL_GetWindowSurface(pWindow), &position); + break; + + } + } + } +} +*/ + + diff --git a/playerInterface.c b/playerInterface.c index 690b5ab..705d6b0 100644 --- a/playerInterface.c +++ b/playerInterface.c @@ -6,17 +6,31 @@ */ #include "playerInterface.h" +//#include "arenaEngine.h" #include "SDL2/SDL.h" #include #include -#define ArenaMAX 100 +enum {GRASS, ROCK, TREE,FIRSTPLAYER, IA1}; +#define BLOC_SIZE 34 // Taille d'un bloc (carré) en pixels +#define NB_BLOCS_LARGEUR 20 +#define NB_BLOCS_HAUTEUR 20 +#define LARGEUR_FENETRE BLOC_SIZE * NB_BLOCS_LARGEUR +#define HAUTEUR_FENETRE BLOC_SIZE * NB_BLOCS_HAUTEUR -int PlayerInterface(void) + +int PlayerInterface(SDL_Window* pWindow,ARENA_H_TILE* arena,SDL_Surface **Sprites) { + //Ajouté + SDL_Rect position; + SDL_Rect oldposition; + SDL_Rect IAposition; + SDL_Rect oldIAposition; + + PLAYER* List=NULL; PLAYER* Element=NULL; int id=0; @@ -41,31 +55,49 @@ int PlayerInterface(void) printf("Nom player 2 : %s\n",player2->Name); numberAlive = NumberPlayerAlive(List); - printf("Nombre de joueur en vie : %i",numberAlive); + printf("Nombre de joueur en vie : %i\n",numberAlive); - - int action; + int action=0; do { - action=getEvent(); - if(action == 1) + oldposition.x = player1->PositionX * BLOC_SIZE; + oldposition.y = player1->PositionY * BLOC_SIZE; + oldIAposition.x = player2->PositionX * BLOC_SIZE; + oldIAposition.y = player2->PositionY * BLOC_SIZE; + + //Affichage des joueurs au début de la partie + SDL_BlitSurface(Sprites[FIRSTPLAYER], NULL, SDL_GetWindowSurface(pWindow), &oldposition); + SDL_BlitSurface(Sprites[IA1], NULL, SDL_GetWindowSurface(pWindow), &oldIAposition); + + SDL_UpdateWindowSurface(pWindow); + + while(action == 0) { - ActionPlayer(player1,1); //Déplacement vers le haut + action=getEvent(); + } + + if(action == -1) + { + return -1; + } + else if(action == 1) + { + ActionPlayer(arena,player1,1); //Déplacement vers le haut } else if(action == 2) { - ActionPlayer(player1,2); //Déplacement vers la droite + ActionPlayer(arena,player1,2); //Déplacement vers la droite } else if(action == 3) { - ActionPlayer(player1,3); //Déplacement vers le bas + ActionPlayer(arena,player1,3); //Déplacement vers le bas } else if(action == 4) { - ActionPlayer(player1,4); //Déplacement vers la gauche + ActionPlayer(arena,player1,4); //Déplacement vers la gauche } else if(action == 5) { @@ -74,16 +106,50 @@ int PlayerInterface(void) } + //Partie ajoutée + // On place le joueur à la bonne position + position.x = player1->PositionX * BLOC_SIZE; + position.y = player1->PositionY * BLOC_SIZE; + //SDL_BlitSurface(actualPlayer, NULL, SDL_GetWindowSurface(pWindow), &position); + + // Effacement de l'écran + //SDL_FillRect(SDL_GetWindowSurface(pWindow), NULL, SDL_MapRGB(SDL_GetWindowSurface(pWindow)->format, 255, 255, 255)); + + SDL_BlitSurface(Sprites[FIRSTPLAYER], NULL, SDL_GetWindowSurface(pWindow), &position); + SDL_BlitSurface(Sprites[GRASS], NULL, SDL_GetWindowSurface(pWindow), &oldposition); + + + //Tour de l'IA - IAEngine(player1,player2); + IAEngine(arena,player1,player2); + + IAposition.x = player2->PositionX * BLOC_SIZE; + IAposition.y = player2->PositionY * BLOC_SIZE; + + SDL_BlitSurface(Sprites[IA1], NULL, SDL_GetWindowSurface(pWindow), &IAposition); + SDL_BlitSurface(Sprites[GRASS], NULL, SDL_GetWindowSurface(pWindow), &oldIAposition); + + SDL_UpdateWindowSurface(pWindow); + + action=0; } - while(action != -1); + while((player1->HealthPoints >0) && (NumberPlayerAlive(List) > 1)); + printf("La partie est terminée\n"); + + if(player1->HealthPoints > 0) + { + printf("Vous avez gagné\n"); + } + else + { + printf("Vous avez perdu\n"); + } + + //Si une des IA meurt, voir comment on le gère return -1; - - //return 0; } @@ -97,63 +163,36 @@ int getEvent() { /* Si c'est un événement de type "Quitter" */ case SDL_QUIT : printf("QUITTER\n"); - action = -1; - break; + //action = -1; + //break; + return -1; case SDL_KEYUP: switch(event.key.keysym.sym) //La valeur de touche { - case SDLK_UP: printf("FLECHE DU HAUT\n"); - action = 1; - break; + case SDLK_UP: printf("FLECHE DU HAUT\n"); + return 1; + case SDLK_DOWN: printf("FLECHE DU BAS\n"); - action = 3; - break; - case SDLK_RIGHT: printf("FLECHE DE DROITE\n"); - action = 2; - break; + return 3; + + case SDLK_RIGHT:printf("FLECHE DE DROITE\n"); + return 2; + case SDLK_LEFT: printf("FLECHE DE GAUCHE\n"); - action = 4; - break; + return 4; + case SDLK_SPACE:printf("BARRE D'ESPACE\n"); - action = 5; + return 5; } break; } - return action; + + + + return 0; } - - - - - -/* - - - ActionPlayer(player2,1); //Déplacement vers le haut - ActionPlayer(player2,2); //Déplacement vers la droite - ActionPlayer(player2,3); //Déplacement vers le bas - ActionPlayer(player2,4); //Déplacement vers la gauche - -*/ - - - //freeElement(List, 2); // Fonctionne - //freeList(List); // Fonctionne - - //displayList(List); - - /** Pour la simulation d'un combat, on rentre la lettre A au clavier - * Le joueur 1 va attaqué le joueur 2 et inversement - * On affiche le score des joueurs - * - * */ - //List = AttackPlayer(List, 1, 2); - -// SDL_Quit(); - - /**Fonction qui crée un joueur * * */ @@ -162,6 +201,7 @@ PLAYER* createPlayer(int Id) PLAYER* player=NULL; //Utilisé la fonction de récupération de la taille de l'arène + int race; player=(PLAYER*)malloc(sizeof(PLAYER)); if(player==NULL) { @@ -170,10 +210,36 @@ PLAYER* createPlayer(int Id) printf("Entrer le nom du joueur\n"); scanf("%s",player->Name); - printf("Nb PV?\n"); - scanf("%d",&player->HealthPoints); + + do + { + printf("Race? 1:Orc 2: Elf 3:Humain \n"); + scanf("%d",&race); + } + while((race < 1) || (race > 3)); + + player->Race = race; + + switch(race) + { + //Race ORC + case 1: player->HealthPoints = 100; + player->AttacksPoints = 10; + break; + + //Race Elfe + case 2: player->HealthPoints = 80; + player->AttacksPoints = 9; + break; + + //Race Humaine + case 3: player->HealthPoints = 90; + player->AttacksPoints = 9; + break; + } + player->Id = Id; - player->AttacksPoints = 10; + //player->AttacksPoints = 10; if(Id == 1) { @@ -182,18 +248,19 @@ PLAYER* createPlayer(int Id) } else if(Id ==2) { - player->PositionX=ArenaMAX; + player->PositionX=ARENAMAX - 1; + //player->PositionX=5; player->PositionY=0; } else if(Id ==3) { player->PositionX=0; - player->PositionY=ArenaMAX; + player->PositionY=ARENAMAX - 1; } else { - player->PositionX=ArenaMAX; - player->PositionY=ArenaMAX; + player->PositionX=ARENAMAX - 1; + player->PositionY=ARENAMAX - 1; } player->suiv=NULL; @@ -333,7 +400,6 @@ PLAYER * SearchPlayer(PLAYER *Head, int idPlayer) } } - void AttackPlayer( PLAYER *player1, PLAYER *player2) { printf("Fonction Attaque\n"); @@ -342,8 +408,9 @@ void AttackPlayer( PLAYER *player1, PLAYER *player2) if((player1 != NULL) && (player2 != NULL)) { - while((player1->HealthPoints > 0) && (player2->HealthPoints > 0)) + if((player1->HealthPoints > 0) && (player2->HealthPoints > 0)) { + printf("\n\n** Tour **\n"); printf("Attaque Joueur %d sur joueur %d \n",player1->Id,player2->Id); @@ -353,33 +420,21 @@ void AttackPlayer( PLAYER *player1, PLAYER *player2) printf("Joueur %d : %s PV = %d\n ",player1->Id,player1->Name,player1->HealthPoints); printf("Joueur %d : %s PV = %d\n ",player2->Id,player2->Name,player2->HealthPoints); - if((player1->HealthPoints > 0) && (player2->HealthPoints > 0)) + /*if((player1->HealthPoints > 0) && (player2->HealthPoints > 0)) { printf("\nAttaque Joueur %d sur joueur %d\n ",player2->Id,player1->Id); player1->HealthPoints = player1->HealthPoints - player2->AttacksPoints; printf("Joueur %d : %s PV = %d\n ",player1->Id,player1->Name,player1->HealthPoints); printf("Joueur %d : %s PV = %d \n",player2->Id,player2->Name,player2->HealthPoints); - } + }*/ } - if(player1->HealthPoints > player2->HealthPoints) - { - printf("Combat finie \n Le joueur 1 a gagné le combat\n"); - } - else if(player1->HealthPoints < player2->HealthPoints) - { - printf("Combat finie \n Le joueur 2 a gagné le combat\n"); - } - else - { - printf("Combat finie \n Les 2 joueurs sont morts"); - } } } -void ActionPlayer(PLAYER * player, int action) +void ActionPlayer(ARENA_H_TILE* arena,PLAYER * player, int action) { /* action = 1 --> Déplacement d'1 carreau vers le haut * action = 2 --> Déplacement d'1 carreau vers la droite @@ -387,6 +442,8 @@ void ActionPlayer(PLAYER * player, int action) * action = 4 --> Déplacement d'1 carreau vers la gauche * * */ + int ID; + if(player != NULL) { @@ -396,7 +453,116 @@ void ActionPlayer(PLAYER * player, int action) - printf("\n**** Player %s ****",player->Name); + printf("\n**** Player %s ****\n",player->Name); + + if(action == 1) + { + printf("On veut aller vers le haut\n"); + ID = getTileTypeID(arena, positionX, positionY -1); + printf("ID case[%i][%i] : %i \n",positionX,positionY-1,ID); + + if((positionY-1 >= 0) && (ID == 0)) + { + player->PositionY = positionY-1; + printf("Déplacement de 1 vers le haut\n La nouvelle position est de X: %i et Y: %i \n",player->PositionX,player->PositionY); + } + else + { + printf("Impossible d'aller vers le haut\n"); + } + } + else if(action == 2) + { + printf("On veut aller vers la droite\n"); + ID = getTileTypeID(arena, positionX + 1, positionY); + printf("ID case[%i][%i] : %i \n",positionX+1,positionY,ID); + + if((positionX + 1 < ARENAMAX) && (ID == 0)) + { + player->PositionX = positionX + 1; + printf("Déplacement de 1 vers la droite\n La nouvelle position est de X: %i et Y: %i \n",player->PositionX,player->PositionY); + } + else + { + printf("Impossible d'aller vers la droite\n"); + } + } + else if(action == 3) + { + printf("On veut aller vers le bas\n"); + ID = getTileTypeID(arena, positionX, positionY + 1); + printf("ID case[%i][%i] : %i \n",positionX,positionY+1,ID); + + if((positionY + 1 < ARENAMAX) && (ID == 0)) + { + player->PositionY = positionY + 1; + printf("Déplacement de 1 vers le bas\n La nouvelle position est de X: %i et Y: %i \n",player->PositionX,player->PositionY); + } + else + { + printf("Impossible d'aller vers le bas\n"); + } + } + else if(action == 4) + { + printf("On veut aller vers la gauche\n"); + ID = getTileTypeID(arena, positionX - 1, positionY); + printf("ID case[%i][%i] : %i \n",positionX-1,positionY,ID); + + if((positionX - 1 >= 0) && (ID == 0)) + { + player->PositionX = positionX - 1; + printf("Déplacement de 1 vers la gauche\n La nouvelle position est de X: %i et Y: %i \n",player->PositionX,player->PositionY); + } + else + { + printf("Impossible d'aller vers la gauche\n"); + } + } + else + { + printf("Autre action\n"); + ID = getTileTypeID(arena, positionX, positionY -1); + printf("ID case[%i][%i] : %i \n",positionX,positionY-1,ID); + + ID = getTileTypeID(arena, positionX + 1, positionY); + printf("ID case[%i][%i] : %i \n",positionX+1,positionY,ID); + + ID = getTileTypeID(arena, positionX, positionY + 1); + printf("ID case[%i][%i] : %i \n",positionX+1,positionY,ID); + + ID = getTileTypeID(arena, positionX - 1, positionY); + printf("ID case[%i][%i] : %i \n",positionX-1,positionY,ID); + + + } + } + else + { + printf("Echec, le joueur est NULL\n"); + } +} + + +/* +void ActionPlayer(PLAYER * player, int action) +{ + /* action = 1 --> Déplacement d'1 carreau vers le haut + * action = 2 --> Déplacement d'1 carreau vers la droite + * action = 3 --> Déplacement d'1 carreau vers le bas + * action = 4 --> Déplacement d'1 carreau vers la gauche + * + * + + if(player != NULL) + { + // récupère la position du personnage. La position de l'instance sur l'arène est récupérer par une fonction + int positionX = player->PositionX; + int positionY = player->PositionY; + + + + printf("\n**** Player %s ****\n",player->Name); if(action == 1) { @@ -416,7 +582,7 @@ void ActionPlayer(PLAYER * player, int action) { printf("On veut aller vers la droite\n"); - if(positionX + 1 <= ArenaMAX) + if(positionX + 1 < ARENAMAX) { player->PositionX = positionX + 1; printf("Déplacement de 1 vers la droite\n La nouvelle position est de X: %i et Y: %i \n",player->PositionX,player->PositionY); @@ -430,7 +596,7 @@ void ActionPlayer(PLAYER * player, int action) { printf("On veut aller vers le bas\n"); - if(positionY + 1 <= ArenaMAX) + if(positionY + 1 < ARENAMAX) { player->PositionY = positionY + 1; printf("Déplacement de 1 vers le bas\n La nouvelle position est de X: %i et Y: %i \n",player->PositionX,player->PositionY); @@ -447,7 +613,7 @@ void ActionPlayer(PLAYER * player, int action) if(positionX - 1 >= 0) { player->PositionX = positionX - 1; - printf("Déplacement de 1 vers le bas\n La nouvelle position est de X: %i et Y: %i \n",player->PositionX,player->PositionY); + printf("Déplacement de 1 vers la gauche\n La nouvelle position est de X: %i et Y: %i \n",player->PositionX,player->PositionY); } else { @@ -463,6 +629,5 @@ void ActionPlayer(PLAYER * player, int action) { printf("Echec, le joueur est NULL\n"); } -} - +}*/ diff --git a/playerInterface.h b/playerInterface.h index 5003f1e..6f3e0da 100644 --- a/playerInterface.h +++ b/playerInterface.h @@ -4,6 +4,7 @@ * Created on: 17 juin 2018 * Author: isen */ +#include "arenaEngine.h" #ifndef PLAYERINTERFACE_H_ #define PLAYERINTERFACE_H_ @@ -15,7 +16,8 @@ typedef struct Player { int Id; char Name[35]; - char Race[20]; + //char Race[20]; + int Race; int HealthPoints; int AttacksPoints; @@ -23,6 +25,7 @@ typedef struct Player int PositionX; int PositionY; + //char Weapons[Max_Weapons]; //int Coins; @@ -41,9 +44,14 @@ PLAYER * freeList(PLAYER *Head); PLAYER * SearchPlayer(PLAYER *Head, int idPlayer); void AttackPlayer( PLAYER *player1, PLAYER *player2); -void ActionPlayer(PLAYER * player, int action); +//void ActionPlayer(PLAYER * player, int action); +void ActionPlayer(ARENA_H_TILE* arena,PLAYER * player, int action); int NumberPlayerAlive(PLAYER *Head); int getEvent(void); +#define ARENAMAX 20 + + + #endif /* PLAYERINTERFACE_H_ */ diff --git a/stone_resize.png b/stone_resize.png new file mode 100755 index 0000000000000000000000000000000000000000..2ea3e89ea24dfbba152d3f2968cfa2de58172240 GIT binary patch literal 1835 zcmV+`2h{k9P)WFU8GbZ8()Nlj2>E@cM*00xgqL_t(o!_Al5Zd=C{ zhQB%NBPohUOO|Zej%?LA7;W$R0)2x%P+z6*P@qlkg0v`*6mgxnh~qeJVW6^*8%J6|ZUlJ+ zv%)b-DqbXxNg+rp$27O>XO6wp(DWr+J;leDG+TX1KN7^AKnjNt7XUfP;M4Cb?me%V zm6qLEy+~=nT1VyT@09`OFFw0~;mc75F97d@uK1l#tH$}!S2kkGp+dB6T#-jGQabB{PxnAj!NI0Bl{VA`lw=< zIHZs$snJR!UZ?5Xgn-pShhJ=7VW?O6F71(7{dz@=g>Q$3zi$^f970N3OHCr*C&_cN zyr41_m9aSIPVHVSK%H}o&v6X8%Y3|boqneS3hw89nkwgZI7SQmGRRR5e|c0fN^A24 z5c)p-PMgXailQXRGP1ltX-yP|gn^Imdj!6Zkb>DPW&iMq$#h1RW;El7+c!73e5s3+ z0&5)!KL1G9Xv%_X!6D)_h;?v(*Yf$3qBhvgjTT^CZBrNoG#d@N{We$DSLyXTL{Wh6 z`)I8YLXspYd;13rM|+G$V>}7{&Js!~taFPbJ+dKp(={5ZWT2B1kfRL#^nJlmX&1(d z<3ydy+-O8xy|&J+Ti5CLyLg_)T6@NdC(OO}RJ-1Nm zO<0sxw0j-$BI9uHpjPiVsVx{J<0`5_zIbZ+Vy8F*VVz^C8FS~8Eq?Xuj|jsM2Uu$_ zR=Um+h9SK{pE56*OeO#*De;sf^nIFI)F6L;Y)HzQ(z;qaB_$hI*ZA=EP2xslA?v$@ zbB;J}GFZ7p6li=YSZ+jgTTNObVfDp#HAteDSYL@L%8H^WDawlF8m0qSPtBRs5$;*o6R*Ng^D+nRZ98T{7 z5ok#_)bwJXNK2#;$Yclq`CZhDZ^79bWIZxWY>4k`8iY9Kh~fx=#X9?L0P}2X`ig$+ z(GER4CBat6@gw}9nED?GMgqi>n_}9oO5Ua?NGC}0!xWen5ljG`#;eg8rrfs%A1k8bP{c?w}IV!BK4 z{43P>0n(PQp3pj8PTMPA+EtpQq-l0BMXV*1hISx{wT3c7?L8v+@iX*`f4vf7p-8L@ z>p{j&5iCws927-Pnk2N_tqa&lB}>!F&{Q zro!2mC#pA1L`7v7?T;C6KR`VD>RgC3W58;V(@=(KrO-;T)M~K0(r3_JLOFxQ;gE2S zO;Rdk5KxpUS)O4{ak1gKsVmka!*kJMFz7Joby;pT=RMFahDGZHPRNsC^?$PNMPQx9&YzrC$N|15iM)_J32>Rh zpf09}5{|8Kj}`R;2U*I2Sf|kO$qI|4s+EyA3=ZcM$Ky_*C9$v3TH*&GR(jZrf&h4~ zpg(&|E8C@&?J|xxI0!G}q=%Td@8kYlTV=3VoKQr*M<))50}qR%ibAGdK>7Ns)A{!r z-^}RG9?{H)w8Ay^<7-U90SI+Q9dXLCyt_24>>p4Chvzetlg#;_8ra zHl>~KvL9bz9A0M@^gy@;keHXd-p`Gq9 zimtKOxJK?REg+nO(pao@NGVP=JVzkQQ&+S109gRpl14rxD);GR+l-B?+bGJs_EI3%gIAX9=_K& Z`Cs`SEHe>)SPTFF002ovPDHLkV1ggHT-X2r literal 0 HcmV?d00001 diff --git a/tree_resize.png b/tree_resize.png new file mode 100755 index 0000000000000000000000000000000000000000..62fb848ffbf6e1a0a9aeb9aef192550aa817ba96 GIT binary patch literal 2233 zcmV;q2uAmbP)WFU8GbZ8()Nlj2>E@cM*00nk6c$3 z#(($TH`d%$-PP?L?6%W!9219-1hPN`0a8$4l^twYAOt%WkpRI4b}ZTQ2e3f0vWg%| zqy!S73__73j4UKWh=+J=x`wVd-+{%ewB2z#Ar84xNhQ6y?|${2?|kQ+E6P`Y<+z7s zExflQxta!?TG4a@&8J!3y==O$WBAi~$FKi<6S19K*Yys&*J{==PsrbbUV^04g#qTsxzK@D-JvT*x^n3txQSRI8oTF&;cqiQ8J8y;jXk(YJ ztK-po<*BY>2ZR=#0e<|U` zvpb9{Q)|!jk%50J6j_ETa-1?Mpfx)!OkHFH2` zWf>*ly|@2H)M^rU+N_+|VlW)?{)J04TTRTN6`u1C@f0uJ2_$T{2$~J5G$Xyay{8M4 zrnsuY2?;{X4|RK@6haXV`V^xHLJC%nZ$fF9jV7ei8NH1a7Ke)zRmJ@$kJDcs5X2Ee zcy|}8lM)dH$iSzXC73h^Gq>)!5NplM-O~z0sAwHprnS5X*3xb@DND_8Ym?q^k=3Jz z5kgQoOVo(xAjHRHjRQT)&`E|((%Q)YC*l602hhdxrNeL&=GWKd0~n6g9#0rB#H#_9@Up7cTp zWZ)xxADlr5!NwO(apciQ@I4Pv6bzOI_?|})$Hc7`d6J-Y9a=RPxh^ZpthhTPdX`X3 zW_2nW4c3v}*v6FAo<@XJs3<^qlKZ~+7^}y(5WxC_Cy=fph$EacEG+gJ-PmU5+I5oY zF1U`B?=R_S&-RMwDA6Otrled|et z5IASK_OA;}uHL9K#yN~JNFnzE>qP;&D5$idB_v0VZy}|?TF1_{n`muWyYDc5;3K6Z zPjg5P05YA-XfzvyfsczrCX)$TYdYN~MNuM@pxNsn!vN<5o&q5x);b#PkfoJHoVDzZ z#&uOz5~UPHo|ES#zVD%=!1FwcEN42I9UK~M9Fx&5i%UI}U!xw4#xxosN-5U2Hd*L* z8SRW|bh`|OU8Cs;r;0HcfOVx}qxY-31Ju_Rc&Ik-Gn%bh+8p9np0JpwiM_*r?t>0jw2)nfy6oo zqNX1qk;)@(283~h9#rI6N}42f)xH}eAFM1d$%_)tuPd*oJlYFAJmuk>qcV>E`Z|qv z8&5%_5hH}4)RwX`bF%~Gc}Q8mUP_7bz1ph|VB-!TLI~QOHp^=(#Bod*hMaixBu7ph zBWyHq&ar%Wl~%V+e|?okuSZsDDr2$EA*7u9jojy)#u%(MD9=ZF-bZ(6jb_YnWs&vG zb;3BJ%5#?1mKmfc#|P@4T*$@`l`~+eF_Z2qSJ@xk@sbvM^kvzcR!a zgE8h-Yv3H7s(&l?tU%+ey^SP=sJjLto$}4`n`~7V4rXMH5znXzkGV_yzB9Uikx<@N8E^U)}gD4s?zm=fHekO-8O1t>S{gr5h)c?N-81w%H(YxP0!NNGd|ps z+;y(`i$2b2d4j5}&{@Iy{hN2pF2)*kS)q-g)9qr7*_WC^NxUFrExX3kqn8=l@x2XL zQyuaLcak$|4I4)De=YW9S+m_D2*Vnr5c9DMq_gzO313a#=5xjQPd9RQyn^p?h9}JX zyp|u~EX!yiYg*?A8*7nD-C{xrdgYi0viEp$_bmeS|8Mp^rf#s|wmGMlc};F{-t|!u z+?;{ibju^Nb38tMhoK#PHn#!3uzcRX%2Bt&IlaaUZi}fOBLrv!CujfW%d@vwFcU)e z$?r-&@%>0g6g=U*%R^k|dGiRDOP^=bSJ^Bs;&E?xBLM#euT07l5jN5-00000NkvXX Hu0mjfrrr&i literal 0 HcmV?d00001 diff --git a/zombie_resize.png b/zombie_resize.png new file mode 100755 index 0000000000000000000000000000000000000000..bb2ddde0f992726c35d15cfe05fc0dbaffed6a71 GIT binary patch literal 2264 zcmV;}2q*W6P)WFU8GbZ8()Nlj2>E@cM*00=xuL_t(o!_Ajjh^1E% z$A5Lsx7@wA>7JgRC6mb{W0V*oWJJXU)ToG}h^Rzg6vU^*xPTh;B^XgbR74TfCqdK~ z6*LGj#tjo=ATa2d#F%Ynx_f%MZ{O~F``gZ`@}Z3j&N$O~vK~);P`^`ORh@qcm$CQW zc1Jpsb$Tw(-XOSl0Vf5fG0d=4gTG+5WtcZrRn@}OMk4%G)ZO>BFWvQLuE69{jt|`N z5!dg}%xDu&I+1G;c{9jK%%;ukxzD1S?qH^7=FH46i-wiJ6JqXLF7dzc*jDP3oiE<~ znQ*Ci$)y~F-c)YUPC9WP0=X8mqh{JRRZR7{D|j>O1NsnrNt-+AP*l6-)`aG2Gv`w&s=fgGMpsXq=}BM%|C(p`lkK zP&$NN81;q;WQ_p?#8$v2{|m%j?C{6m|9n&pV>2sbYI@;NWaU_(niksR^kbX0Zy|$} z?ImIDs>u3bWw>Mv4=L+Ml+i*&9biR9eiUXWh5&j^K`kfbCj3$PjIxgK} zZDWP=t%mX8DXM)P##-rCJvpP%eSLlQz*m>A`&e-~kV}sE2Vdbfq#b_KbnPwX-L#bn zrACToOd$>JB&C?jFfVMjI-IvHHj*)Qs4+Fkqo&6%Y%RX+=YLv!4?KA}5PvDh?YCYd z(;J(|qi~B8<`Tpu2slS@j#`v$saWw7ma~e@wo>N~6(Nf%N4BcuRnKe<7B}nG`(Ji+ z_0_i=8vf+|r)^Ie8Qu9(|HofFdtyD$UVmVJwQqgUk}`1wflcpN$vwkt%qRf`yz}%L zWo{?XS7q8cuGJA9!j{AitH~V&mPL(x7j>et9z6tnEm2LKL`w z@wgYB>bICI%+Q{hr$B!0PI!oS!amwzx=2`jl6Y+{c zR`TpXk*7C#lco9X+I7nS0?vef9qHCJ2f9Xg?gma={aV@)&YruUjg2SiloRHCO4o$S zi=CU!{bu40)+2f62l{Y{f5t`*d7IJ?dMQAvL%uy0$LD?PpF=u$IP2rp?J zAe1F#(GbPx^;)!2Ph-ZglkxCUpJ)3SD%O1XUiPNYP92$^O-zG`wpY*4lsoA5d8S*&pw}h!2~nU-yev<*I5U;^DlhZb-Tn3+Kl{qo z6@k3qf!hY&J8RPC_e5cJ-MP z3<%DFG3C{cd2#c=m4PIw>=!tJ+N`Nji=ZM@UZ^^rGAdwrGpw0VE}zB;w5%eHo@}gO z5PQ2~Np`1Z=8eN%*#|svMIh#+N7Ol@FvEi9z4Yx>sH!-c2loAyG?=wuqpqXRVvDmU(teNkSxIs2bKphzxAMJ? zNwG-h9XG|97u_JfdvJb{c0V8pQRB{Nxbe&3#@gwH0|#Ew=}w&#=lW)b08y|cYb+-K`O2_pdBjD53r>+q(!*P5-#lBlw~ z#1vFfHN>z5%U5q<;fF`E-j9}_{=u2&rAGiB{Oz~r zv-Z?+anj%26?TV$0jM>xt~Gh+k>Gl*Z8f!jZ8ZYmMJ>C2Yg>Nu_~t12{F**5ke}WC z?qv1c@{&(BW<`iV1t=n7W~w3fV^bgA+1xrcwYYy>M25fuSoP0Irq-{k@|MTb>aj1s z|1}SP_&fL4dj@IyftzfPE$HMC5x4S>d+P2UX(>YK5TAB@HXdy}ZpJ-=oJK?i)Idb= mf*2x8hpsww8mReyx4#2D?OX95wUz+@0000