diff --git a/constante.c b/constante.c index bd243f1f8a0267a9d9dd395f62f2ae5a0a4c2c1b..496dcc5dcdc2cdefb1e8787ee635525bb4582b05 100644 --- a/constante.c +++ b/constante.c @@ -43,7 +43,7 @@ * \brief Vitesse initiale de déplacement vertical des éléments du jeu */ -#define INITIAL_SPEED 16 +#define INITIAL_SPEED 2 /** * \brief Nombre de lignes de météorites diff --git a/library/Display/Display.c b/library/Display/Display.c index c285fbb76ad23a24137931af3febf03dffd25a1b..1506aa9673e0d3faa766a9ae79837f2577036c2a 100644 --- a/library/Display/Display.c +++ b/library/Display/Display.c @@ -18,19 +18,21 @@ void init_ressource(SDL_Renderer *renderer, ressources_t *textures){ textures->soleilBarre = load_image( "ressources/Elements/soleil.png",renderer); textures->soleil = load_image( "ressources/Elements/soleil.png",renderer); - + textures->nb_init = 9; init_ressource_element(renderer, textures); + } void init_ressource_element(SDL_Renderer *renderer, ressources_t *textures){ textures->meteorite = load_image( "ressources/meteorite.bmp",renderer); textures->e_rotate = load_image("ressources/Elements/reverse.bmp", renderer); + textures->coins = load_image("ressources/Elements/coin.png", renderer); + textures->nb_init += 3; } void apply_background(SDL_Renderer *renderer, SDL_Texture *texture, world_t *world, int parallax){ if(texture != NULL){ apply_texture(texture, renderer, 0, -1800+world->parallax/parallax, world->angle*180/M_PI); - } } @@ -54,7 +56,6 @@ void apply_wall(SDL_Renderer * renderer, SDL_Texture *texture, int x, int y,worl rect.y = SCREEN_HEIGHT/2 + (x - SCREEN_WIDTH/2) * sin(world->angle) + (y - SCREEN_HEIGHT/2) * cos(world->angle); rect.w = METEORITE_SIZE; rect.h = METEORITE_SIZE; - if (SDL_RenderCopyEx(renderer, texture, NULL, &rect, world->angle*180/M_PI, NULL, SDL_FLIP_NONE) != 0){ printf("ok\n"); } @@ -69,13 +70,14 @@ void apply_walls(SDL_Renderer * renderer, SDL_Texture *texture, world_t *world, apply_wall(renderer, res->meteorite, world->murs[i]->x+i3*METEORITE_SIZE, world->murs[i]->y+i2*METEORITE_SIZE, world); }else if(strcmp(world->murs[i]->id, "2") == 0){ apply_wall(renderer, res->e_rotate, world->murs[i]->x+i3*METEORITE_SIZE, world->murs[i]->y+i2*METEORITE_SIZE, world); + }else if(strcmp(world->murs[i]->id, "3") == 0){ + apply_wall(renderer, res->coins, world->murs[i]->x+i3*METEORITE_SIZE, world->murs[i]->y+i2*METEORITE_SIZE, world); } } } } } - void refresh_graphics(SDL_Renderer *renderer, world_t *world,ressources_t *textures){ //on vide le renderer clear_renderer(renderer); @@ -104,9 +106,7 @@ void refresh_graphics(SDL_Renderer *renderer, world_t *world,ressources_t *textu printf("aaa"); } - update_screen(renderer); - } int timer_update_s(world_t *world){ diff --git a/library/Display/Display.h b/library/Display/Display.h index 8a293a987d63f108adb70f93e83a72c066fc2505..7b2eeaf2d239f944981170c33c41d92d533d0ab7 100644 --- a/library/Display/Display.h +++ b/library/Display/Display.h @@ -36,8 +36,10 @@ struct ressources_s{ SDL_Texture* background2; /*!< Texture liée à l'image du fond de l'écran. (effet parallax) */ SDL_Texture* background3; /*!< Texture liée à l'image du fond de l'écran. (effet parallax) */ SDL_Texture* ship; /*!< Texture liée à l'image du vaisseau. */ + SDL_Texture* meteorite; /*!< Texture liée à l'image du météorite. */ SDL_Texture* e_rotate; /*!< Texture liée à l'image de l'élément de rotation. */ + SDL_Texture* coins; /*!< Texture liée à l'image des pièces. */ SDL_Texture* finishLine; /*!< Texture liée à l'image de la ligne d'arrivée. */ SDL_Texture* BarreProgression; /*!< Texture liée à l'image de l'air. */ SDL_Texture* vaisseauMini; /*!< Texture liée à l'image du vaisseau. */ @@ -48,6 +50,7 @@ struct ressources_s{ TTF_Font *font; // Font SDL_Color color; // Color long double angle; /*!< Angle de rotation de l'image. */ + int nb_init; /*!< Nombre d'initialisation. */ }; typedef struct ressources_s ressources_t; diff --git a/library/Display/Display.o b/library/Display/Display.o index ca25ecf6e4d4eb9ab0f26344c1819e7fe47de2bf..b35f05eb6ba848349a94357fdb103c74407b09ba 100644 Binary files a/library/Display/Display.o and b/library/Display/Display.o differ diff --git a/library/Sprites/sprites.c b/library/Sprites/sprites.c index 410dde85c1a2e268e45b3868f40d7a3d0f5e230b..c7e81706a2b7a851a349101f2d90677263c84d9f 100644 --- a/library/Sprites/sprites.c +++ b/library/Sprites/sprites.c @@ -13,7 +13,7 @@ void print_sprite(sprite_t *sprite){ } -sprite_t *init_sprite(sprite_t *sprite, int x, int y, int w, int h, char id){ +sprite_t *init_sprite(sprite_t *sprite, int x, int y, int w, int h, char id, int indice){ sprite = malloc(sizeof(sprite_t)); sprite->x = x; sprite->y = y; @@ -22,7 +22,7 @@ sprite_t *init_sprite(sprite_t *sprite, int x, int y, int w, int h, char id){ sprite->id = malloc(sizeof(char) * 10); sprite->dy = 0.0; strcpy(sprite->id, &id); - + sprite->indice = indice; return sprite; } diff --git a/library/Sprites/sprites.h b/library/Sprites/sprites.h index 79f3dd814a6fd87cbb82c0820ee63170381c9f58..229ba63824fac19852759f4b444bace98ae35264 100644 --- a/library/Sprites/sprites.h +++ b/library/Sprites/sprites.h @@ -30,6 +30,7 @@ struct sprite_s{ int h; float dy; char * id; + int indice; }; typedef struct sprite_s sprite_t; @@ -59,7 +60,7 @@ void print_sprite(sprite_t *sprite); * \param h * \return sprite_t* */ -sprite_t *init_sprite(sprite_t *sprite, int x, int y, int w, int h, char id); +sprite_t *init_sprite(sprite_t *sprite, int x, int y, int w, int h, char id, int indice); /** * \brief La fonction indique si les sprites se touchent diff --git a/library/Sprites/sprites.o b/library/Sprites/sprites.o index bd4c4897dd5bcc4379a2ebba4c8024a83d39b192..b52ea3ebefe689154a5a3a0a5f5135bf17bea7df 100644 Binary files a/library/Sprites/sprites.o and b/library/Sprites/sprites.o differ diff --git a/library/World/world.c b/library/World/world.c index fa2da20f49a0befe9d2974c4a81ab0a4999c4272..498e23e31404d2a16969b5fd83c3588492b5fe3b 100644 --- a/library/World/world.c +++ b/library/World/world.c @@ -8,24 +8,32 @@ void init_data(world_t * world){ world->speed_h = (float)INITIAL_SPEED; init_walls(world); // Initialisation du vaisseau - world->vaisseau = init_sprite(world->vaisseau, SCREEN_WIDTH/2 - SHIP_SIZE/2, SCREEN_HEIGHT - SHIP_SIZE-15, SHIP_SIZE, SHIP_SIZE, '0'); - world->ligneArriver = init_sprite(world->ligneArriver, 0, -world->nb_lines_murs*METEORITE_REAL_SIZE-30 , SCREEN_WIDTH, FINISH_LINE_HEIGHT, 'z'); - world->BarreProgression = init_sprite(world->BarreProgression, 10, SCREEN_HEIGHT - 500, 50, 400, 'y'); - world->vaisseauMini = init_sprite(world->vaisseauMini, 10, SCREEN_HEIGHT - 130, 20, 20, 'x'); - world->soleilBarre = init_sprite(world->soleilBarre, 0, SCREEN_HEIGHT - 510, 40, 40, 'x'); - world->soleil = init_sprite(world->soleil, SCREEN_WIDTH/2-1800/2, -world->nb_lines_murs*METEORITE_REAL_SIZE-1400, 1800, 1800, 'z'); + world->vaisseau = init_sprite(world->vaisseau, SCREEN_WIDTH/2 - SHIP_SIZE/2, SCREEN_HEIGHT - SHIP_SIZE-15, SHIP_SIZE, SHIP_SIZE, '0', 0); + world->ligneArriver = init_sprite(world->ligneArriver, 0, -world->nb_lines_murs*METEORITE_REAL_SIZE-30 , SCREEN_WIDTH, FINISH_LINE_HEIGHT, 'z', 0); + world->BarreProgression = init_sprite(world->BarreProgression, 10, SCREEN_HEIGHT - 500, 50, 400, 'y', 0); + world->vaisseauMini = init_sprite(world->vaisseauMini, 10, SCREEN_HEIGHT - 130, 20, 20, 'x', 0); + world->soleilBarre = init_sprite(world->soleilBarre, 0, SCREEN_HEIGHT - 510, 40, 40, 'x', 0); + world->soleil = init_sprite(world->soleil, SCREEN_WIDTH/2-1800/2, -world->nb_lines_murs*METEORITE_REAL_SIZE-1400, 1800, 1800, 'z', 0); + world->air = init_sprite(world->air, -2000, -2000, 0, 0, 'x', 0); + world->coins = init_sprite(world->coins, SCREEN_WIDTH-40, 10, 30, 30, 'x', 0); world->vaisseauMini->y = SCREEN_HEIGHT - (110); world->vaisseauMini->dy = SCREEN_HEIGHT - (110); - print_sprite(world->vaisseau); world->startTimer = SDL_GetTicks(); world->timer = SDL_GetTicks(); - world->str = malloc(sizeof(char)*100); + world->str = malloc(sizeof(char)*100); // Allocation de la mémoire pour le string temps + + + world->coins_str = malloc(sizeof(char)*100); // Allocation de la mémoire pour le string coins + world->coins_str[0] = '\0'; + world->coins_str = strcats(world->coins_str, 1, "0"); + world->angle = 0.0; world->isFlipping = 0; world->isMenu = false; + world->money = 0; world->parallax = 0; - world->invicibility = true; + world->invicibility = false; } void update_data(world_t *world){ @@ -36,45 +44,53 @@ void update_data(world_t *world){ world->vaisseauMini->dy -= world->speed_h/(MAX_LINES*METEORITE_REAL_SIZE+700)*400; world->vaisseauMini->y = (int)world->vaisseauMini->dy; + outBorder(world); + world->parallax += (int)world->speed_h; update_walls(world); - if (isOverScreen(world->vaisseau)){ - if (world->vaisseau->x < 0) world->vaisseau->x = 0; - if (world->vaisseau->x + world->vaisseau->w > SCREEN_WIDTH) world->vaisseau->x = SCREEN_WIDTH - world->vaisseau->w; - if (world->vaisseau->y < 0) world->vaisseau->y = 0; - if (world->vaisseau->y + world->vaisseau->h > SCREEN_HEIGHT) world->vaisseau->y = SCREEN_HEIGHT - world->vaisseau->h; - } + world->money2 = world->money; if (!world->invicibility){ for(int i = 0; i < world->nb_murs; i++){ - collide(world->vaisseau, world->murs[i], world, 0); + collide(world->vaisseau, world->murs[i], world); } } - collide(world->vaisseau, world->ligneArriver, world, 1); + + if (timer_update_s(world) != 0){ + world->str[0] = '\0'; + world->str = strcats(world->str, 3, "temps: ",int_to_str((int)world->timer/1000), "s"); + } + collide(world->vaisseau, world->ligneArriver, world); // Collision avec la ligne d'arriver allEvents(world); - world->timer = SDL_GetTicks(); } } +void outBorder(world_t *world){ + if (isOverScreen(world->vaisseau)){ + if (world->vaisseau->x < 0) world->vaisseau->x = 0; + if (world->vaisseau->x + world->vaisseau->w > SCREEN_WIDTH) world->vaisseau->x = SCREEN_WIDTH - world->vaisseau->w; + if (world->vaisseau->y < 0) world->vaisseau->y = 0; + if (world->vaisseau->y + world->vaisseau->h > SCREEN_HEIGHT) world->vaisseau->y = SCREEN_HEIGHT - world->vaisseau->h; + } +} int is_game_over(world_t *world){ return world->gameover; } - -void clean_data(world_t *world){ - /* utile uniquement si vous avez fait de l'allocation dynamique (malloc); la fonction ici doit permettre de libérer la mémoire (free) */ - free(world->vaisseau); - free(world->ligneArriver); - free(world->murs); - free(world->str); - printf("clean_data"); +int timer_update_s(world_t *world){ + if (world->timer%1000 <= 110|| world->timer%1000 >= 985){ + return world->timer%1000; + } + return 0; } -void collide(sprite_t *sp1, sprite_t *sp2, world_t *world, int make_disappear){ + + +void collide(sprite_t *sp1, sprite_t *sp2, world_t *world){ if (sprites_collide(sp1, sp2)){ - printf("%s\n", sp2->id); + printf("aaa: %s\n", sp2->id); if (strcmp(sp2->id, "1") == 0){ world->gameover = 1; }else if(strcmp(sp2->id, "2") == 0){ @@ -85,6 +101,9 @@ void collide(sprite_t *sp1, sprite_t *sp2, world_t *world, int make_disappear){ } }else if(strcmp(sp2->id, "z") == 0){ world->gameover = 1; + }else if(strcmp(sp2->id, "3") == 0){ + world->money += 1; + remove_wall(world, sp2->indice); } } } @@ -116,17 +135,10 @@ void init_walls(world_t *world){ int nb_elements = 0; char **txt = lirefile("maps/default.txt", &world->nb_lines_murs); - // for (int i = 0; i < world->nb_lines_murs; i++) { - // for (int j = 0; j < MAX_LENGTH; j++) { - // murs2[nb_elements] = txt[i][j]; - // nb_elements++; - // } - // } - for (int i = 0; i < world->nb_lines_murs; i++) { for (int j = 0; j < MAX_LENGTH; j++) { if (txt[i][j] != '0'){ - world->murs[world->nb_murs] = init_sprite(world->murs[world->nb_murs], j*METEORITE_SIZE+2, (i*METEORITE_SIZE)-(METEORITE_SIZE*world->nb_lines_murs), METEORITE_SIZE, METEORITE_SIZE, txt[i][j]); + world->murs[world->nb_murs] = init_sprite(world->murs[world->nb_murs], j*METEORITE_SIZE+2, (i*METEORITE_SIZE)-(METEORITE_SIZE*world->nb_lines_murs), METEORITE_SIZE, METEORITE_SIZE, txt[i][j], world->nb_murs); world->nb_murs++; } } @@ -143,8 +155,36 @@ void update_walls(world_t *world){ } } +void remove_wall(world_t *world, int index){ + free(world->murs[index]); + world->murs[index] = world->air; + world->murs[index]->indice = index; +} + void allEvents(world_t *world){ + if (world->money2 != world->money){ + world->coins_str[0] = '\0'; // On vide le string + world->coins_str = strcat(world->coins_str, int_to_str(world->money)); + } + if (world->isFlipping != 0){ flipScreen(world); } } + +void clean_data(world_t *world){ + /* utile uniquement si vous avez fait de l'allocation dynamique (malloc); la fonction ici doit permettre de libérer la mémoire (free) */ + free(world->vaisseau); + free(world->ligneArriver); + free(world->murs); + free(world->str); + free(world->vaisseauMini); + free(world->soleilBarre); + free(world->soleil); + free(world->BarreProgression); + free(world->coins); + free(world->coins_str); + free(world->air); + + printf("clean_data"); +} \ No newline at end of file diff --git a/library/World/world.h b/library/World/world.h index bc4bccc7dfe4b36f3611ae50a630c506d8900c04..80bc15556bdb4b2784765a0ca55030052f81091c 100644 --- a/library/World/world.h +++ b/library/World/world.h @@ -41,6 +41,7 @@ struct world_s{ sprite_t *vaisseauMini; sprite_t *soleilBarre; sprite_t *soleil; + sprite_t *air; int nb_murs; // Nombre de météorites int nb_lines_murs; // Nombre de lignes de météorites sprite_t *ligneArriver; @@ -52,6 +53,7 @@ struct world_s{ double angle; // Angle de rotation de la map int isFlipping; // Indique si l'on est en train de faire une rotation de l'écran et dans quelle sens (0 : non droite, 1 : vers la droite, -1 : vers la gauche, -2 : non gauche) bool isMenu; + int money; int parallax; bool invicibility; @@ -118,6 +120,8 @@ void init_walls(world_t *world); */ void update_walls(world_t *world); +void remove_wall(world_t *world, int index); + /** * \brief La fonction qui execute toutes les actions du jeu * diff --git a/library/World/world.o b/library/World/world.o index 25d0a95c7915071d1028a6742e77e602c4527c9f..e9e805d04704cd38c15318fa295d40586d79c8eb 100644 Binary files a/library/World/world.o and b/library/World/world.o differ diff --git a/main.c b/main.c index 28879a84b03370a3bc975de8e6392742ca7263e8..e8999d4c00c1b849b5af06a909fc2f03df6ba45e 100644 --- a/main.c +++ b/main.c @@ -48,8 +48,6 @@ void handle_events(SDL_Event *event,world_t *world){ switch (event->key.keysym.sym){ case SDLK_z: world->speed_h = 4; - - printf("%f\n", world->speed_h); break; case SDLK_s: world->speed_h = INITIAL_SPEED; diff --git a/main.o b/main.o index d64b196fbec15598f07cf46ceb3e4a4fd22a43ae..4a30a338e59dce2bf6d60e9958547885cb47d969 100644 Binary files a/main.o and b/main.o differ diff --git a/maps/default.txt b/maps/default.txt index ce994eba6d194b527aab953e914baac1ae24660a..1b75ca18ad9c23cdf647f4984a1930e8e2203767 100644 --- a/maps/default.txt +++ b/maps/default.txt @@ -3,9 +3,9 @@ 00000000000000000000000000 00000000000000000000000000 00000000000000000000000000 -00000000000000000000000000 -00000000000011000000000001 -00000000011111100000000001 +00000000000000000033300000 +00000000000011000330030001 +00000000011111100003030001 10000000111111110000000001 10000000111111111111000001 11000001111111111111000001 @@ -14,15 +14,15 @@ 11000011111111111111100001 11000011111111111111100001 10000011111111111111000001 -10000011111111111111000001 -10000001111111111111000001 -00000001111111111111000000 -00020000011111111110000000 -00000000001111111100000000 -00000000001111111000000000 -00000000001111000000000000 -00000110001110000000000000 -00000000000110000000000000 +10000011111111111111000301 +10000001111111111111003301 +00000001111111111111003300 +00020000011111111110003300 +00000000001111111100003300 +00000000001111111000003000 +00000000001111000000033000 +00000110001110000000030000 +00000000000110000000030000 00000000000110000000000000 00000000000000000000000000 00000000000000000000000000 @@ -35,7 +35,7 @@ 00000000000000000000011110 00000000000000000000011110 00011000000000000000011110 -00011000022000000000111110 +00011000020000000000111110 00000000000000000000111110 00000000000000000001111110 00000000000000000001111110 @@ -48,20 +48,20 @@ 11110000000110011111111111 11111000000000011111111111 11111000000000011111111111 -11111000000000011111111111 +11111000000030011111111111 11111100000000011111111111 -11111100000000001111111111 -11111110000000000011111111 +11111100030000001111111111 +11111110000030000011111111 11111110000000000001111111 -11111111000000000001111111 -11111111000000000011111111 -11111111100000000011111111 +11111111003000000001111111 +11111111003030300011111111 11111111100000000011111111 +11111111100300000011111111 11111111100000000011111111 -11111111100000000001111111 -11111111100000000001111111 +11111111100000300001111111 +11111111103300000001111111 11111111100000000000111111 -11111111100000000000011111 +11111111100003000000011111 11111111100000000000001111 11111111100000000000001111 11111111100000000000000111 @@ -73,29 +73,29 @@ 11111000000000000000000001 11111000000000000000000001 11110000000000000000000001 -11100000000000000000000001 -11100000000000000000000001 -11000000000000000000000001 -11000000000000000000000001 -10000000000000000000000001 +11100000000033000000000001 +11100000000333300000000001 +11000000000333300000000001 +11000000000033000000000001 +10000033000000000000000001 10000000000000000000000001 10000000000010000000000001 -10000000000010000000000001 +10003000033000000000000001 00000000000000000000000001 00000000000000000000000000 -00000000000000000000000000 -00000000000000100000000000 -00000000000000000000000000 -00000000000000000000000000 -00000000000000000000000000 -00000000000000000000000000 -00001100000100000000000000 -00000000000110000000111110 +00300000003000000000000000 +00000330300000100000000000 +00000000000030000000000000 +00300000000000000000000000 +00000000300000000000000000 +00000000300000000000000000 +00001000000000000000000000 +00000000000100000000111110 00000000000000000001111110 -00000000000000000111111110 -00000000000000001111111110 -00000000000000001111111110 -00000000000000011111111110 +00330000000000000111111110 +03333000000000001111111110 +03333000000000001111111110 +00330000000000011111111110 00000000000000111111111110 00000000000100111111111110 00000000001110111111111110 @@ -103,10 +103,10 @@ 00000000001101111111111110 00000000000001111111111110 00000000000001111111111110 -00000000000001111111111110 -01100000000000111111111110 -11100000000000111111111110 -11100000000000111111111110 +00000000330001111111111110 +00000003333000111111111110 +11100003333000111111111110 +11100000330000111111111110 11100000000001111111111110 00000000000001111111111110 00000000000001111111111110 @@ -115,15 +115,15 @@ 00020000000011111111111110 00000000000111111111111110 00000000000111111111111110 +00000000000111111111111110 00000000001111111111111110 00000000001111111111111110 00000000001111111111111110 00000000001111111111111110 00000000001111111111111110 -00000000001111111111111110 -00110000001111111111111110 -01110000001111111111111110 -00110000001111111111111110 +00100000001111111111111110 +01100000001111111111111110 +00100000001111111111111110 00000000000111111111111110 00000000000111111111111110 00000000000011111111111110 @@ -152,17 +152,17 @@ 00000011111111111111000000 00000011111111111111000000 00000011111111111111000000 -00000001111111111111000000 -00000001111111111111000000 -00000001111111111111000000 -00000000111111111111000000 -00000000111111111110000000 -00000000111111111100000000 -00000000111111111100000000 -00000000111111111000000000 -00000000111111111000000000 +00030001111111111111000000 +00003001111111111111000000 +00333001111111111111000000 +00003000111111111111000000 +00333300111111111110000000 +00330000111111111100000000 +00333300111111111100000000 +00300000111111111000000000 +00303030111111111000000000 00000000111111110000000000 -00000000011111110000000000 +00033000011111110000000000 00000000000011000000000000 00000000000000000000000000 00000000000000000000000000 @@ -183,28 +183,28 @@ 00001111000000000000000000 00011111000000000000000000 00011111000000000000000000 -00111111111110000000000000 +00111111111110000300030000 00111111111111000000000000 00111111111111100000000000 00111111111111100000000000 -00111111111111100000000000 -00111111111111100000000000 +00111111111111100003000000 +00111111111111103000033000 01111111111111100000000000 -01111111111111100000000000 -11111111111111100000000000 -11111111111111000000000000 -11111111111110000000000001 +01111111111111100003000000 +11111111111111100003000000 +11111111111111003000003000 11111111111110000000000001 +11111111111110000303003001 +11111111111100030000000001 +11111111111103300000030001 +11111111111100000300030001 +11111111111100300000000001 11111111111100000000000001 -11111111111100000000000001 -11111111111100000000000001 -11111111111100000000000001 -11111111111100000000000001 -11111111111100000000001101 +11111111111100330300001101 11111111111100000000011111 +11111111111000300000111110 11111111111000000000111110 -11111111111000000000111110 -01111111110000000000011110 +01111111110000003300011110 00011111100000000000011100 00000000000000000000000000 00000000000000000000000000 @@ -216,13 +216,13 @@ 00000000000000000000000110 00000000000000000000001110 00000000000000000000011110 -00001100000000000000111110 -00011110000000000001111110 -00011110000000000001111110 -00011100000000000001111100 -00000000000000000001111100 -00000000000000000001111100 -00000000000000000001111110 +03301100000000000000111110 +03311110000000000001111110 +33311110000000000001111110 +33311100000000000001111100 +03333000000000000001111100 +03333000000000000001111100 +00333000000000000001111110 00000000000000000001111100 00000000000000000011111100 00000000000000000111111100 @@ -239,10 +239,10 @@ 00000111111000111111100000 00000111111000111111110000 00000111111000111111110000 -00000111110000111111111000 -00011111110000011111111000 -00111111110000011111111000 -01111111100000001111110000 +00000111110330111111111000 +00011111110330011111111000 +00111111110330011111111000 +01111111100330001111110000 01111111100000000111110000 11111111100000000111110000 11111111100000000111100000 @@ -256,12 +256,12 @@ 11111100000000000110000000 11111000000000001110000000 00000000000000011110000000 -00000000000000011110000000 -00000000000000011110000000 -00000000000000000000000000 -00000000000000000000000000 -00000000000000000000000000 -00000000000000000000000000 +00000000033000011110000000 +00000000333300011110000000 +00000003333330000000000000 +00000003333330000000000000 +00000000333300000000000000 +00000000033000000000000000 00000000000000000000000000 00000000000000000000000000 00000000000000000000000000 @@ -277,16 +277,16 @@ 00000000000111111111111100 00000000000111111111111120 00000000000111111111111100 -00000000000111111111111100 -00000000000111111111111000 -00000000000111111111111000 -00000000000111111111111000 -00000000001111111111110000 -00000000001111111111110001 -11000000011111111111100001 -11000000011111111111100001 -11000000011111111111000001 -11000000011111111110000001 +00330000000111111111111100 +00030000000111111111111000 +00033000000111111111111000 +00003000000111111111111000 +00003000001111111111110000 +00003000001111111111110001 +11003300011111111111100001 +11003300011111111111100001 +11003000011111111111000001 +11003000011111111110000001 10000000011111111110000001 10000000011111111100000000 00000000011111111100000000 @@ -330,12 +330,12 @@ 11111111111100000000000001 11111111111100000000000001 11111111111100000000000001 -11111111111100000000000001 -11111111111100000000000001 -11111111111100000000000001 -11111111111100000000000001 -11111111111000000000000001 -11111111111000000000000001 +11111111111100003000000001 +11111111111100030300000001 +11111111111100303030000001 +11111111111103030303000001 +11111111111000300030000001 +11111111111003000003000001 11111111111000000000000001 11111111110000000000000001 11111111110000000000000001 @@ -369,11 +369,11 @@ 00000000000000000000111110 00000020000000000001111110 00000000000000000001111110 -00000000000000000001111110 -10000000000000000001111111 -11000000000000000001111111 -11000000000011000001111111 -11000000000111000001111110 +00000000330000000001111110 +10000003300000000001111111 +11000033000000000001111111 +11000330000011000001111111 +11000300000111000001111110 00000000000011000001111110 00000000000000000011111110 00000000000000000011111110 @@ -404,21 +404,21 @@ 11110000000000011111111111 11110000000000011111111111 11111000000000011111111111 -11111000000000011111111111 -11111000000000111111111111 -11111100000000111111111111 -11111100000000111111111111 -11111100000000111111111111 -11111110000000111111111111 -11111110000000111111111111 -11111110000000111111111111 -11111111000000111111111111 -11111111000000111111111111 -11111111100000011111111111 -11111111100000001111111111 -11111111110000001111111111 -11111111110000000111111111 -11111111110000000011111111 +11111000030000011111111111 +11111000030000111111111111 +11111100030000111111111111 +11111100030000111111111111 +11111100030000111111111111 +11111110030000111111111111 +11111110003000111111111111 +11111110003000111111111111 +11111111003300111111111111 +11111111000300111111111111 +11111111100300011111111111 +11111111100300001111111111 +11111111110300001111111111 +11111111110330000111111111 +11111111110030000011111111 11111111110000000001111111 11111111110000000000111111 11111111111000000000001111 @@ -441,27 +441,27 @@ 11111100010000000110000001 11111100010000000110000001 11111100000000000110000001 -11111100000000000000000001 -11111100000000000000000001 +11111100000000000000003301 +11111100000000000000003301 11111100000000000000000001 11111100000000000000000001 11111110000000000000000001 -11111110000000000000000001 -11111110000000000000000001 -11111110000000000000110001 -11111110000000000000010001 -11111110000000000000000001 -11111111000000000000000001 -11111111000000000000000001 -11111111100000000000000001 +11111110300000000000000001 +11111110330000000000000001 +11111110330000000000110001 +11111110330000000000010001 +11111110330000000000000001 +11111111033000000000000001 +11111111003300000000000001 +11111111100000000000003001 11111111110000000000000001 11111111111000000000000001 +11111111111100000000003001 11111111111100000000000001 -11111111111100000000000001 -11111111111110000000000001 -11111111111110000000000001 -11111111111110000000000001 11111111111110000000000001 +11111111111110000030000001 +11111111111110003000000001 +11111111111110000003000001 11111111111110000000000001 11111111111110000000000001 11111111111110000000000001 @@ -479,14 +479,14 @@ 00000000000000000000000000 00000000000000000000000000 00000000000000000000000000 -00000000000000000000000000 -00000000000000000000000000 -00000000000000000000000000 -00000000000000000000000000 -00000000000000000000000000 -00000000000000000000000000 -00000000000000000000000000 -00000000000000000000000000 +00000000000300033000000000 +00000000000330333300000000 +00000000003330303300000000 +00000000003033303300000000 +00000000033003003300000000 +00000000033000003300000000 +00000000030000003000000000 +00000000000000033000000000 00000000000000000000000000 00000000000000000000000000 00000000000000000000000000 diff --git a/maps/map.png b/maps/map.png index 1dac74b5485d2314aa88a36e64b2ea148154927c..b21af76dc937c5ca07016d7ac6d62c971a9382fb 100644 Binary files a/maps/map.png and b/maps/map.png differ diff --git a/maps/map.py b/maps/map.py index f66f221243337b16418bf29cd5a3eec3a6967061..d93a10dd7704aeefad8769dd8439c107863a5b40 100644 --- a/maps/map.py +++ b/maps/map.py @@ -21,6 +21,8 @@ for pixel in pixels: file.write("1") elif pixel[0] == 255 and pixel[1] == 0 and pixel[2] == 0: file.write("2") + elif pixel[0] == 0 and pixel[1] == 255 and pixel[2] == 0 and pixel[3] > 80: + file.write("3") else: file.write("0") compteur += 1 diff --git a/ressources/Elements/coin.png b/ressources/Elements/coin.png new file mode 100644 index 0000000000000000000000000000000000000000..565021cf74044c3c3a634d5ff5585adbb3c797f5 Binary files /dev/null and b/ressources/Elements/coin.png differ diff --git a/spacecorridor.exe b/spacecorridor.exe index e8f47fb05240485befc9f31d76799bd21cf21c5b..f0b6a6f8b6e396b4678948fe6c273ef38b75e782 100644 Binary files a/spacecorridor.exe and b/spacecorridor.exe differ