JEU Finis manque la notice
This commit is contained in:
parent
e6e209067f
commit
15da776376
@ -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.
@ -8,6 +8,7 @@
|
|||||||
#include "../fichier.h/time.h"
|
#include "../fichier.h/time.h"
|
||||||
#include "../fichier.h/main.h"
|
#include "../fichier.h/main.h"
|
||||||
#include "../fichier.h/menu.h"
|
#include "../fichier.h/menu.h"
|
||||||
|
#include "../fichier.h/terrain.h"
|
||||||
|
|
||||||
#define CYCLE 100000L
|
#define CYCLE 100000L
|
||||||
#define DELAI_MILLISECONDES 100
|
#define DELAI_MILLISECONDES 100
|
||||||
@ -67,7 +68,16 @@ int lancer_jeu(){
|
|||||||
Collision_Serpent(pos_x, pos_y, segment, murx, mury, &go_on);
|
Collision_Serpent(pos_x, pos_y, segment, murx, mury, &go_on);
|
||||||
attente(DELAI_MILLISECONDES);
|
attente(DELAI_MILLISECONDES);
|
||||||
Oeuf(pos_x, pos_y, oeufx, oeufy, pointeur_segment);
|
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){
|
int main(void){
|
||||||
|
@ -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) {
|
void Controle(int *direction, int last_direction, int *go_on, int *pause) {
|
||||||
int t;
|
int t;
|
||||||
|
int Pause = ChargerSprite("img/PAUSE.png");
|
||||||
while(ToucheEnAttente()) {
|
while(ToucheEnAttente()) {
|
||||||
t = Touche();
|
t = Touche();
|
||||||
switch(t) {
|
switch(t) {
|
||||||
@ -107,11 +108,15 @@ void Controle(int *direction, int last_direction, int *go_on, int *pause) {
|
|||||||
*go_on = 0;
|
*go_on = 0;
|
||||||
return;
|
return;
|
||||||
case XK_space :
|
case XK_space :
|
||||||
if (*pause == 0 ){
|
*pause = 1;
|
||||||
*pause == 1;
|
AfficherSprite(Pause, 400, 720);
|
||||||
}else{
|
while(*pause){
|
||||||
|
t = Touche();
|
||||||
|
if (t == XK_space){
|
||||||
*pause = 0;
|
*pause = 0;
|
||||||
ChargerImage("img/PAUSE.png", 400,200,0,0,350,300);
|
ChoisirCouleurDessin(CouleurParNom("black"));
|
||||||
|
RemplirRectangle(200,720,800,200);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user