diff --git a/SAE_semestre1/fichier.h/menu.h b/SAE_semestre1/fichier.h/menu.h deleted file mode 100755 index 716d75b..0000000 --- a/SAE_semestre1/fichier.h/menu.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef MENU_H -#define MENU_H - -typedef struct { - int x, y, L, H; -} zone; -int check_zone(zone z, int x, int y); -void afficher_menu(zone jouer, zone quitter, int *jeu); - -#endif \ No newline at end of file diff --git a/SAE_semestre1/src/main.c b/SAE_semestre1/src/main.c deleted file mode 100644 index 9dc3428..0000000 --- a/SAE_semestre1/src/main.c +++ /dev/null @@ -1,70 +0,0 @@ -#include -#include -#include -#include "../fichier.h/serpent.h" -#include "../fichier.h/Oeuf.h" -#include "../fichier.h/time.h" -#include "../fichier.h/main.h" -#include "../fichier.h/menu.h" - -#define CYCLE 100000L - -int lancer_jeu(){ - int pause = 1; - int segment = 10; - int go_on = 1; - int direction = 4; - int minute = 0; - int seconde = 0; - int seconde_actuel = 0; - int old_seconde = 0; - unsigned long int suivant; - int pos_x[2400]; - int pos_y[2400]; - int old_x[2400]; - int old_y[2400]; - int oeufx[5]; - int oeufy[5]; - int murx[30]; - int mury[30]; - char timer[6]; - int *pointeur_segment = &segment; - int *pointeur_go_on = &go_on; - int *pointeur_direction = &direction; - int *pointeur_minute = &minute; - int *pointeur_seconde = &seconde; - unsigned long int *pointeur_suivant = &suivant; - int *pointeur_seconde_actuel = &seconde_actuel; - int *pointeur_old_seconde = &old_seconde; - int *pointeur_pause = &pause; - suivant = Microsecondes()+CYCLE; - old_seconde=(suivant/1000000)%10; - DessinerScene(murx, mury, minute, seconde ,timer); - InitialiserOeufs(oeufx, oeufy, segment); - Serpent(pos_x, pos_y, old_x, old_y, pointeur_segment, murx, mury, pointeur_go_on, pointeur_direction); - while(go_on){ - Controle(pointeur_direction, 0, pointeur_go_on, pointeur_pause); - if(pause == 1){ - Timer( pointeur_minute, pointeur_seconde, pointeur_suivant, pointeur_seconde_actuel, pointeur_old_seconde, timer); - Update_Serpent(pos_x, pos_y, segment, old_x, old_y, pointeur_direction); - Collision_Serpent(pos_x, pos_y, segment, murx, mury, pointeur_go_on); - Score(segment); - usleep(100000); - Oeuf(pos_x, pos_y, oeufx, oeufy, pointeur_segment); - } - } -} -int main(void){ - int choix = 0; - InitialiserGraphique(); - CreerFenetre(350,100,1200,900); - EffacerEcran(CouleurParComposante(0,0,0)); - afficher_menu(&choix); - - while( choix == 1){ - lancer_jeu(); - } - FermerGraphique(); - return EXIT_SUCCESS; -} - diff --git a/SAE_semestre1/src/menu.c b/SAE_semestre1/src/menu.c deleted file mode 100755 index 5c7a832..0000000 --- a/SAE_semestre1/src/menu.c +++ /dev/null @@ -1,24 +0,0 @@ -#include -#include -#include -#include "../fichier.h/menu.h" - -int check_zone(zone z, int x, int y) { - return x >= z.x && x <= z.x + z.L && y >= z.y && y <= z.y + z.H; -} - -void afficher_menu(zone jouer, zone quitter, int *choix) { - ChargerImageFond("../img/Menu.png"); - while(1){ - SourisPosition(); - - if(SourisCliquee()){ - int x = _X; - int y = _Y; - if (check_zone(jouer, _X, _Y)){ - *choix = 1; - return; - } - } - } -}