JEU Finis manque la notice

This commit is contained in:
JUDE CHRIST AISSI 2023-12-22 16:27:53 +01:00
parent e6e209067f
commit 15da776376
6 changed files with 26 additions and 16 deletions

View File

@ -1,5 +0,0 @@
#ifndef FONCTIONS_H
#define FONCTIONS_H
#endif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

View File

@ -8,6 +8,7 @@
#include "../fichier.h/time.h"
#include "../fichier.h/main.h"
#include "../fichier.h/menu.h"
#include "../fichier.h/terrain.h"
#define CYCLE 100000L
#define DELAI_MILLISECONDES 100
@ -67,7 +68,16 @@ int lancer_jeu(){
Collision_Serpent(pos_x, pos_y, segment, murx, mury, &go_on);
attente(DELAI_MILLISECONDES);
Oeuf(pos_x, pos_y, oeufx, oeufy, pointeur_segment);
}else{
Controle(pointeur_direction, 0, &go_on, pointeur_pause);
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);
dessinerSerpent(pos_x, pos_y, segment, old_x, old_y);
Collision_Serpent(pos_x, pos_y, segment, murx, mury, &go_on);
attente(DELAI_MILLISECONDES);
Oeuf(pos_x, pos_y, oeufx, oeufy, pointeur_segment);
}
}
}
int main(void){

View File

@ -79,6 +79,7 @@ void Collision_Serpent(int pos_x[], int pos_y[], int segment, int murx[], int mu
void Controle(int *direction, int last_direction, int *go_on, int *pause) {
int t;
int Pause = ChargerSprite("img/PAUSE.png");
while(ToucheEnAttente()) {
t = Touche();
switch(t) {
@ -107,11 +108,15 @@ void Controle(int *direction, int last_direction, int *go_on, int *pause) {
*go_on = 0;
return;
case XK_space :
if (*pause == 0 ){
*pause == 1;
}else{
*pause = 1;
AfficherSprite(Pause, 400, 720);
while(*pause){
t = Touche();
if (t == XK_space){
*pause = 0;
ChargerImage("img/PAUSE.png", 400,200,0,0,350,300);
ChoisirCouleurDessin(CouleurParNom("black"));
RemplirRectangle(200,720,800,200);
}
}
}
}