Skip to content
Snippets Groups Projects
Commit 08685323 authored by Samibenzid's avatar Samibenzid
Browse files

Maj menu bouton play et exit

parent fda889ce
No related branches found
No related tags found
No related merge requests found
No preview for this file type
No preview for this file type
......@@ -37,7 +37,10 @@ void init_data(world_t * world){
init_walls(world);
world->ligneArriver = init_sprite(world->ligneArriver, 0, -world->nb_lines_murs*METEORITE_SIZE-30 , SCREEN_WIDTH, FINISH_LINE_HEIGHT, 'z');
world->play = init_btn(0, 0, 100, 100);
world->play = init_btn(100,40, 80, 80);
world->exit = init_btn(100, 300, 80, 80);
world->magasin = init_btn(100, 150, 80, 80);
world->sound = init_btn(0, 0, 100, 100);
print_sprite(world->vaisseau);
world->startTimer = SDL_GetTicks();
......
......@@ -40,7 +40,10 @@ struct world_s{
sprite_t **murs2; /*<Représentation des météorites et de l'air>*/
btn_t *play;
btn_t *exit;
btn_t *magasin;
btn_t *sound;
int nb_murs; // Nombre de météorites
int nb_lines_murs; // Nombre de lignes de météorites
sprite_t *ligneArriver;
......
No preview for this file type
No preview for this file type
No preview for this file type
......@@ -75,6 +75,14 @@ void handle_events(SDL_Event *event,world_t *world){
printf("tesy");
world->isMenu = false;
}
if (collidePoint(world->magasin, world->mouseX, world->mouseY)){
printf("tesy");
world->isMenu = false;
}
if (collidePoint(world->exit, world->mouseX, world->mouseY)){
printf("tesy");
world->gameover = true;
}
}
}
}
......
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment