diff --git a/Makefile b/Makefile index 60b0c1e24e78cbd219fd45c7be044e5bbca6d4ba..27efdece066be0fff213e822f3f031ff1b732710 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ LDFLAGS = -lm -lmingw32 -lSDL2main -lSDL2 -lSDL2_ttf SDL2_INCLUDE_DIR = src/include SDL2_LIBRARIES_DIR = src/lib -INC = sdl2-light.h sdl2-ttf-light.h library/Display/Display.h library/World/world.h library/Sprites/sprites.h library/utility/utility.h +INC = sdl2-light.h sdl2-ttf-light.h library/Display/Display.h library/World/world.h library/Sprites/sprites.h library/utility/utility.h SRC = main.c sdl2-light.c sdl2-ttf-light.c library/Display/Display.c library/World/world.c library/Sprites/sprites.c library/utility/utility.c OBJ = $(SRC:%.c=%.o) @@ -21,8 +21,12 @@ doc: $(PROG) .PHONY: clean -start: +map: + python -u maps/map.py + +start: $(PROG) + clean: del /f /q *.o *~ $(PROG) rd /s /q latex html \ No newline at end of file diff --git a/library/Display/Display.c b/library/Display/Display.c index 6a7134b9682837d6ac590e18a10e4cd1ea90afb5..6fc28aa12a377435fe47d9f2cb6ba62ece7fe193 100644 --- a/library/Display/Display.c +++ b/library/Display/Display.c @@ -75,19 +75,19 @@ void refresh_graphics(SDL_Renderer *renderer, world_t *world,ressources_t *textu //application des textures dans le renderer apply_background(renderer, textures->background, world); - apply_sprite(renderer, textures->ship, world->vaisseau, world); - - apply_sprite(renderer, textures->finishLine, world->ligneArriver, world); - - apply_walls(renderer, textures->meteorite, world, textures); - - 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"); + if (!world->isMenu){ + apply_sprite(renderer, textures->ship, world->vaisseau, world); + apply_sprite(renderer, textures->finishLine, world->ligneArriver, world); + apply_walls(renderer, textures->meteorite, world, textures); + + 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"); + } + apply_text(renderer, 10, 10, 100, 33, world->str, textures->font, textures->color); + }else{ + apply_text(renderer, 10, 10, 100, 33, "Menu", textures->font, textures->color); } - - apply_text(renderer, 10, 10, 100, 33, world->str, textures->font, textures->color); - update_screen(renderer); diff --git a/library/Display/Display.o b/library/Display/Display.o index 854c7794d2432bc604814da3d85ca44cb80e5a48..0e46948a3d8e05ac496b156ce6185e4adec15441 100644 Binary files a/library/Display/Display.o and b/library/Display/Display.o differ diff --git a/library/Sprites/sprites.o b/library/Sprites/sprites.o index ffdda1429f76936fee3fbd83332bf3faf04a06db..796391e0984f8bb31c401238dbe68a3cca30be23 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 078224c58d9c87126b0203b1e4f38e5c0ddad0ab..07e0bdb29aa6fee37a4c83d78ba4cfbd3cefdbbf 100644 --- a/library/World/world.c +++ b/library/World/world.c @@ -2,22 +2,24 @@ #include "../utility/utility.h" void update_data(world_t *world){ - world->ligneArriver->y += (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; - } - for(int i = 0; i < world->nb_murs; i++){ - collide(world->vaisseau, world->murs[i], world, 0); - } - collide(world->vaisseau, world->ligneArriver, world, 1); + if (!world->isMenu){ + world->ligneArriver->y += (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; + } + for(int i = 0; i < world->nb_murs; i++){ + collide(world->vaisseau, world->murs[i], world, 0); + } + collide(world->vaisseau, world->ligneArriver, world, 1); - allEvents(world); + allEvents(world); - world->timer = SDL_GetTicks(); + world->timer = SDL_GetTicks(); + } } @@ -41,6 +43,7 @@ void init_data(world_t * world){ world->str = malloc(sizeof(char)*100); world->angle = 0.0; world->isFlipping = 0; + world->isMenu = true; } @@ -92,9 +95,18 @@ void flipScreen(world_t *world){ void init_walls(world_t *world){ world->nb_murs = 0; world->murs = malloc(sizeof(sprite_t) * MAX_LENGTH*MAX_LINES); + // char **murs2 = malloc(sizeof(char*) * MAX_LENGTH*MAX_LINES); world->nb_lines_murs = 0; + 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'){ @@ -105,6 +117,10 @@ void init_walls(world_t *world){ } } +void wallChoose(world_t *world, char **murs, int posX, int posY){ + return; +} + void update_walls(world_t *world){ for (int i = 0; i < world->nb_murs; i++){ world->murs[i]->y += world->speed_h; diff --git a/library/World/world.h b/library/World/world.h index ae0ee801f094d9ddbde3ae30401e0e5099260766..b580f78f0fa6fb5494e07f8879f816f1528dd72e 100644 --- a/library/World/world.h +++ b/library/World/world.h @@ -2,7 +2,7 @@ #include <stdlib.h> #include "../Sprites/sprites.h" #include "../../constante.c" -#include <SDL2/SDL.h> +#include "../../src/include/SDL2/SDL.h" #include <stdbool.h> /** @@ -36,6 +36,7 @@ struct world_s{ sprite_t *vaisseau ; /*!< Représentation du vaisseau */ sprite_t **murs; /*<Représentation des météorites>*/ + sprite_t **murs2; /*<Représentation des météorites et de l'air>*/ int nb_murs; // Nombre de météorites int nb_lines_murs; // Nombre de lignes de météorites sprite_t *ligneArriver; @@ -46,7 +47,7 @@ struct world_s{ char * str; // String affichant le temps sur le jeu 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; }; typedef struct world_s world_t; diff --git a/library/World/world.o b/library/World/world.o index 9ebfc49ffead55bf0dc3b69241610fb0695f02b0..ac91e73d5027e653c28f16359537079ab2194eb5 100644 Binary files a/library/World/world.o and b/library/World/world.o differ diff --git a/library/menu/menu.c b/library/menu/menu.c new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/library/menu/menu.h b/library/menu/menu.h new file mode 100644 index 0000000000000000000000000000000000000000..0e52d5e7cf299601ac2b5dad594f78d201d4aa60 --- /dev/null +++ b/library/menu/menu.h @@ -0,0 +1,8 @@ +#include <stdio.h> +#include <stdlib.h> +#include "../../src/include/SDL2/SDL.h" + +struct btn{ + SDL_Rect rect; + SDL_Texture *texture; +} \ No newline at end of file diff --git a/library/utility/utility.h b/library/utility/utility.h index 34cbc63c006a31fbfa3ca5dfc282f594221c3fda..5913cf6999d2e8213d463875dfccd4d8f95a3552 100644 --- a/library/utility/utility.h +++ b/library/utility/utility.h @@ -12,8 +12,8 @@ #ifndef Utility_h #define Utility_h -#define MAX_LINES 1000 -#define MAX_LENGTH 200 +#define MAX_LINES 500 +#define MAX_LENGTH 28 /** * \brief Concatène plusieurs chaines de caractères diff --git a/library/utility/utility.o b/library/utility/utility.o index 33d9e361a2a8b4f81fdf340747aee3ffd720a1bd..3ab3761c00d488f6924c02b7f94aa7aabcb2b55c 100644 Binary files a/library/utility/utility.o and b/library/utility/utility.o differ diff --git a/main.c b/main.c index 8f120972d55e4f24282bf1c6906be5a8a5e374ed..28879a84b03370a3bc975de8e6392742ca7263e8 100644 --- a/main.c +++ b/main.c @@ -24,11 +24,13 @@ void handle_events(SDL_Event *event,world_t *world){ const Uint8 *keystates = SDL_GetKeyboardState(NULL); - if (keystates[SDL_SCANCODE_A]){ - world->vaisseau->x -= MOVING_STEP; - } - if(keystates[SDL_SCANCODE_D]){ - world->vaisseau->x += MOVING_STEP; + if (!world->isMenu){ + if (keystates[SDL_SCANCODE_A]){ + world->vaisseau->x -= MOVING_STEP; + } + if(keystates[SDL_SCANCODE_D]){ + world->vaisseau->x += MOVING_STEP; + } } while( SDL_PollEvent( event ) ) { @@ -42,21 +44,22 @@ void handle_events(SDL_Event *event,world_t *world){ //si une touche est appuyée if(event->type == SDL_KEYDOWN){ //si la touche appuyée est 'D' - - 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; - break; - case SDLK_ESCAPE: - world->gameover = 1; - break; - default: - break; + if (!world->isMenu){ + 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; + break; + case SDLK_ESCAPE: + world->gameover = 1; + break; + default: + break; + } } // print_sprite(world->vaisseau); } diff --git a/main.o b/main.o index d1c17724200b1476c11f0182cd3982547306fbb3..c75890bbd5318a30ae6f6f46094e66ade3cfd500 100644 Binary files a/main.o and b/main.o differ diff --git a/maps/default.txt b/maps/default.txt index 75f4839a3c89fc28a71fd50e17b8428fe1d5d5e6..ce994eba6d194b527aab953e914baac1ae24660a 100644 --- a/maps/default.txt +++ b/maps/default.txt @@ -1,159 +1,500 @@ -0100000000111100000000001 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0000000000000000000000001 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111020111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010211111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111111111101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0012011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -2012011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111000111000001101 -0010011111020111000001101 -0010011111000111000001101 -0010011111000111000001101 +000000000000000000000000000 +00000000000000000000000000 +00000000000000000000000000 +00000000000000000000000000 +00000000000000000000000000 +00000000000000000000000000 +00000000000011000000000001 +00000000011111100000000001 +10000000111111110000000001 +10000000111111111111000001 +11000001111111111111000001 +11000001111111111111000001 +11000001111111111111000001 +11000011111111111111100001 +11000011111111111111100001 +10000011111111111111000001 +10000011111111111111000001 +10000001111111111111000001 +00000001111111111111000000 +00020000011111111110000000 +00000000001111111100000000 +00000000001111111000000000 +00000000001111000000000000 +00000110001110000000000000 +00000000000110000000000000 +00000000000110000000000000 +00000000000000000000000000 +00000000000000000000000000 +00000000100000000000000010 +00001000100000001000000110 +00000000000000001100001110 +00000000000000011100011110 +00000000000000000000011110 +00000000000000000000011110 +00000000000000000000011110 +00000000000000000000011110 +00011000000000000000011110 +00011000022000000000111110 +00000000000000000000111110 +00000000000000000001111110 +00000000000000000001111110 +00000000000000000011111111 +11000000000000000111111111 +11100000000000001111111111 +11100000000110001111111111 +11110000000110011111111111 +11110000000110011111111111 +11110000000110011111111111 +11111000000000011111111111 +11111000000000011111111111 +11111000000000011111111111 +11111100000000011111111111 +11111100000000001111111111 +11111110000000000011111111 +11111110000000000001111111 +11111111000000000001111111 +11111111000000000011111111 +11111111100000000011111111 +11111111100000000011111111 +11111111100000000011111111 +11111111100000000001111111 +11111111100000000001111111 +11111111100000000000111111 +11111111100000000000011111 +11111111100000000000001111 +11111111100000000000001111 +11111111100000000000000111 +11111111100000000000000001 +11111111100000000200000001 +11111111100000000000000001 +11111111000000000000000001 +11111100000000000000000001 +11111000000000000000000001 +11111000000000000000000001 +11110000000000000000000001 +11100000000000000000000001 +11100000000000000000000001 +11000000000000000000000001 +11000000000000000000000001 +10000000000000000000000001 +10000000000000000000000001 +10000000000010000000000001 +10000000000010000000000001 +00000000000000000000000001 +00000000000000000000000000 +00000000000000000000000000 +00000000000000100000000000 +00000000000000000000000000 +00000000000000000000000000 +00000000000000000000000000 +00000000000000000000000000 +00001100000100000000000000 +00000000000110000000111110 +00000000000000000001111110 +00000000000000000111111110 +00000000000000001111111110 +00000000000000001111111110 +00000000000000011111111110 +00000000000000111111111110 +00000000000100111111111110 +00000000001110111111111110 +00000000001111111111111110 +00000000001101111111111110 +00000000000001111111111110 +00000000000001111111111110 +00000000000001111111111110 +01100000000000111111111110 +11100000000000111111111110 +11100000000000111111111110 +11100000000001111111111110 +00000000000001111111111110 +00000000000001111111111110 +00000000000011111111111110 +00000000000011111111111110 +00020000000011111111111110 +00000000000111111111111110 +00000000000111111111111110 +00000000001111111111111110 +00000000001111111111111110 +00000000001111111111111110 +00000000001111111111111110 +00000000001111111111111110 +00000000001111111111111110 +00110000001111111111111110 +01110000001111111111111110 +00110000001111111111111110 +00000000000111111111111110 +00000000000111111111111110 +00000000000011111111111110 +00000000000011111111111110 +00000000000001111111111110 +00000000000000111111111110 +00000000000000011111111110 +00000000000000011111111110 +00000000000000001111111110 +00001111000000001111111110 +00001111000000001111111110 +00001111000000001111111110 +00001111111000001111111110 +00001111111000001111111110 +00001111111100001111111110 +00001111111100011111111110 +00001111111110011111111110 +00000111111111011111111110 +00000111111111111111100000 +00000111111111111111100000 +00000111111111111111100000 +00000111111111111111100000 +00000111111111111111100000 +00000111111111111111100000 +00000111111111111111100000 +00000011111111111111000000 +00000011111111111111000000 +00000011111111111111000000 +00000001111111111111000000 +00000001111111111111000000 +00000001111111111111000000 +00000000111111111111000000 +00000000111111111110000000 +00000000111111111100000000 +00000000111111111100000000 +00000000111111111000000000 +00000000111111111000000000 +00000000111111110000000000 +00000000011111110000000000 +00000000000011000000000000 +00000000000000000000000000 +00000000000000000000000000 +00000000000000000000000000 +00000000000000000000000000 +00000000020000000000000000 +00000000000000001110000000 +00000000000000001111000000 +00000000000000011111000000 +00000000000000111111000000 +00000000000000011110000000 +00000000000000001110000000 +00000000000000000000000000 +00000000000000000000000000 +00000000000000000000000000 +00000110000000000000000000 +00000110000000000000000000 +00001111000000000000000000 +00011111000000000000000000 +00011111000000000000000000 +00111111111110000000000000 +00111111111111000000000000 +00111111111111100000000000 +00111111111111100000000000 +00111111111111100000000000 +00111111111111100000000000 +01111111111111100000000000 +01111111111111100000000000 +11111111111111100000000000 +11111111111111000000000000 +11111111111110000000000001 +11111111111110000000000001 +11111111111100000000000001 +11111111111100000000000001 +11111111111100000000000001 +11111111111100000000000001 +11111111111100000000000001 +11111111111100000000001101 +11111111111100000000011111 +11111111111000000000111110 +11111111111000000000111110 +01111111110000000000011110 +00011111100000000000011100 +00000000000000000000000000 +00000000000000000000000000 +00000000000000000000000000 +00000000000000000000000000 +00000000000000000000000000 +00000000000000000000000000 +00000000000000000000000000 +00000000000000000000000110 +00000000000000000000001110 +00000000000000000000011110 +00001100000000000000111110 +00011110000000000001111110 +00011110000000000001111110 +00011100000000000001111100 +00000000000000000001111100 +00000000000000000001111100 +00000000000000000001111110 +00000000000000000001111100 +00000000000000000011111100 +00000000000000000111111100 +00000000000000001111111000 +00000000000000001111111000 +00000000000000011111111000 +00000000000000111111111000 +00000000000000111111110000 +00000111000001111111110000 +00000111100001111111100000 +00000111110001111111110000 +00000111110000111111110000 +00000111111000111111100000 +00000111111000111111100000 +00000111111000111111110000 +00000111111000111111110000 +00000111110000111111111000 +00011111110000011111111000 +00111111110000011111111000 +01111111100000001111110000 +01111111100000000111110000 +11111111100000000111110000 +11111111100000000111100000 +11111111000000000000000001 +11111111000000000000000001 +11111110000000000000000001 +11111110000200000000000001 +11111110000000000000000001 +11111110000000000000000001 +11111110000000000000000000 +11111100000000000110000000 +11111000000000001110000000 +00000000000000011110000000 +00000000000000011110000000 +00000000000000011110000000 +00000000000000000000000000 +00000000000000000000000000 +00000000000000000000000000 +00000000000000000000000000 +00000000000000000000000000 +00000000000000000000000000 +00000000000000000000000000 +00000000000000011110000000 +11100000000001111110000000 +11100000000011111110000000 +11100000000111111111000000 +01100000000111111111000000 +00000000000111111111000000 +00000000000111111111100000 +00000000000111111111111000 +00000000000111111111111000 +00000000000111111111111100 +00000000000111111111111120 +00000000000111111111111100 +00000000000111111111111100 +00000000000111111111111000 +00000000000111111111111000 +00000000000111111111111000 +00000000001111111111110000 +00000000001111111111110001 +11000000011111111111100001 +11000000011111111111100001 +11000000011111111111000001 +11000000011111111110000001 +10000000011111111110000001 +10000000011111111100000000 +00000000011111111100000000 +00000000011111111100000000 +00000000001111111100000000 +00000000001111111000000000 +00000000000111110000000000 +00000000000111110000000000 +00000000000111100000000000 +00000000000000000000000000 +00000000000000000000000000 +00000000000000000000000000 +00000000000000000000000000 +00000000000000000000000000 +00000110000000000000000000 +00001111000000000000000000 +00001111000000000000000000 +00001111000000000000000000 +00001110000000000000000000 +00000000000000000000000001 +11000000000000000000000001 +11100000000000000000000001 +11110000000000000000001001 +11110000000000000000011101 +11110000000000000000011111 +11110000000000000000011111 +11110000000000000000001101 +11111000000000000000000001 +11111000000000000000000001 +11111100000000000000000001 +11111110000000000000000001 +11111111000000000000000001 +11111111100000000000000001 +11111111110000000000000001 +11111111111000000000110001 +11111111111100000001111001 +11111111111100000011111001 +11111111111100000001111001 +11111111111100000000000001 +11111111111100000000000001 +11111111111100000000000001 +11111111111100000000000001 +11111111111100000000000001 +11111111111100000000000001 +11111111111100000000000001 +11111111111100000000000001 +11111111111100000000000001 +11111111111000000000000001 +11111111111000000000000001 +11111111111000000000000001 +11111111110000000000000001 +11111111110000000000000001 +11111111100000100000000001 +11111111100001110000000001 +11111111000001111000000001 +11111110000001110000000001 +11111100000000000000000001 +11111000000000000000000001 +11111000000000000000000001 +11111000000000000000000001 +11110000000000000000000001 +11110000000000000000000001 +11110000000000000000000001 +11111000000000000001100001 +11111000000000000011110001 +11111000000000000011110001 +11111000000000000011110001 +11111000000000000001100001 +11111000000000000000000001 +11111000110000000000000001 +11111001110000000000000001 +11111001111000000000000001 +11111001110000000000000001 +11110000100000000000000111 +11110000000000000000001111 +10000000000000000000011110 +00000000000000000000011110 +00000000000000000000111110 +00000000000000000000111110 +00000000000000000000111110 +00000020000000000001111110 +00000000000000000001111110 +00000000000000000001111110 +10000000000000000001111111 +11000000000000000001111111 +11000000000011000001111111 +11000000000111000001111110 +00000000000011000001111110 +00000000000000000011111110 +00000000000000000011111110 +00000000000000000011111110 +00000000000000000111111110 +00000000000000000111111110 +00000000000000001111111110 +00000000000000001111111110 +00000000000000001111111110 +00100000000000011111111110 +00100000000000011111111110 +00000000000000111111111110 +00000000000000111111111110 +00000000000000111111111110 +00000000000001111111111110 +00000000000001111111111110 +00000000000001111111111110 +00000000000001111111111110 +00000000000001111111111111 +00002000000001111111111111 +00002000000001111111111111 +10000000000001111111111111 +10000000000001111111111111 +11000000000000111111111111 +11000000000000111111111111 +11100000000000111111111111 +11100000000000111111111111 +11110000000000011111111111 +11110000000000011111111111 +11111000000000011111111111 +11111000000000011111111111 +11111000000000111111111111 +11111100000000111111111111 +11111100000000111111111111 +11111100000000111111111111 +11111110000000111111111111 +11111110000000111111111111 +11111110000000111111111111 +11111111000000111111111111 +11111111000000111111111111 +11111111100000011111111111 +11111111100000001111111111 +11111111110000001111111111 +11111111110000000111111111 +11111111110000000011111111 +11111111110000000001111111 +11111111110000000000111111 +11111111111000000000001111 +11111111111000000000000001 +11111111110000000000000001 +11111111110000000000000001 +11111111110000000000000001 +11111111110000000000000000 +01111111100000000000000000 +00000000000011000000000000 +00000000000001000001100000 +00000000000001000001100000 +00000000000001000000000000 +00000000000000000000000000 +00000000000000000000000000 +01000000000000000000000001 +11110000000000000000000001 +11111000000000000000000001 +11111000010000000000000001 +11111100010000000110000001 +11111100010000000110000001 +11111100000000000110000001 +11111100000000000000000001 +11111100000000000000000001 +11111100000000000000000001 +11111100000000000000000001 +11111110000000000000000001 +11111110000000000000000001 +11111110000000000000000001 +11111110000000000000110001 +11111110000000000000010001 +11111110000000000000000001 +11111111000000000000000001 +11111111000000000000000001 +11111111100000000000000001 +11111111110000000000000001 +11111111111000000000000001 +11111111111100000000000001 +11111111111100000000000001 +11111111111110000000000001 +11111111111110000000000001 +11111111111110000000000001 +11111111111110000000000001 +11111111111110000000000001 +11111111111110000000000001 +11111111111110000000000001 +11111111111110000000000001 +11111111111110000000000001 +11111111111100000000000001 +11111111111000000000000001 +11111110000000000000000001 +11111000000000000000000001 +11000000000000000000000000 +00000000000000000000000000 +00000000000000000000000000 +00000000000000000000000000 +00000000000000000000000000 +00000000000000000000000000 +00000000000000000000000000 +00000000000000000000000000 +00000000000000000000000000 +00000000000000000000000000 +00000000000000000000000000 +00000000000000000000000000 +00000000000000000000000000 +00000000000000000000000000 +00000000000000000000000000 +00000000000000000000000000 +00000000000000000000000000 +00000000000000000000000000 +00000000000000000000000000 +00000000000000000000000000 +00000000000000000000000000 +00000000000000000000000000 +00000000000000000000000000 +00000000000000000000000000 +00000000000000000000000000 +00000000000000000000000000 +0000000000000000000000000 \ No newline at end of file diff --git a/maps/map.png b/maps/map.png new file mode 100644 index 0000000000000000000000000000000000000000..1dac74b5485d2314aa88a36e64b2ea148154927c Binary files /dev/null and b/maps/map.png differ diff --git a/maps/map.py b/maps/map.py new file mode 100644 index 0000000000000000000000000000000000000000..f66f221243337b16418bf29cd5a3eec3a6967061 --- /dev/null +++ b/maps/map.py @@ -0,0 +1,35 @@ +from PIL import Image +import time +image = Image.open('maps/map.png') + + +print("test") +pixels = list(image.getdata()) + + +print(pixels[0]) + +file = open("maps/default.txt", "w") +file.write("") +file.close() + +file = open("maps/default.txt", "a") +compteur = 0 +ligne = 0 +for pixel in pixels: + if pixel[0] == 0 and pixel[1] == 0 and pixel[2] == 0 and pixel[3] != 0: + file.write("1") + elif pixel[0] == 255 and pixel[1] == 0 and pixel[2] == 0: + file.write("2") + else: + file.write("0") + compteur += 1 + if compteur % 26 == 1 and compteur != 1: + file.write("\n") + ligne += 1 + print(pixel, ligne) + + +file.close() + +image.close() diff --git a/spacecorridor.exe b/spacecorridor.exe index 42963cd69cdc4b82be9d0238233ed74f5af8ab39..6209565d9c7e9d0c0ff7c946871c190418bf91db 100644 Binary files a/spacecorridor.exe and b/spacecorridor.exe differ