Des beugs paramètre dans les fonctions
This commit is contained in:
@@ -4,37 +4,20 @@
|
||||
#include "../fichier.h/serpent.h"
|
||||
#include "../fichier.h/pastille.h"
|
||||
|
||||
#define LARGEUR_FENETRE 1250
|
||||
#define HAUTEUR_FENETRE 750
|
||||
#define TAILLE_CELLULE 25
|
||||
#define DELAI_MILLISECONDES 100
|
||||
#define ESPACE_NOIR 100
|
||||
|
||||
void genererPomme() {
|
||||
int pommex[5];
|
||||
int pommey[5];
|
||||
int i;
|
||||
for (i = 0; i < 5; i++) {
|
||||
pommex[i] = rand() % (LARGEUR_FENETRE / TAILLE_CELLULE) * TAILLE_CELLULE;
|
||||
pommey[i] = rand() % (HAUTEUR_FENETRE / TAILLE_CELLULE) * TAILLE_CELLULE;
|
||||
void Pomme(){
|
||||
int pos_x[60];
|
||||
int pos_y[60];
|
||||
int segment = 10;
|
||||
int p, pp;
|
||||
int pomme, pommex[5], pommey[5];
|
||||
for(p=0; p<6; p++){
|
||||
if(pommex[p]==pos_x[0] && pommey[p]==pos_y[0]){
|
||||
segment+=2;
|
||||
pommex[p] = ((rand() % (60)+1)*20);
|
||||
pommey[p] = ((rand() % (27)+1)*20);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void dessinerPomme() {
|
||||
int i;
|
||||
int pommex[5];
|
||||
int pommey[5];
|
||||
ChoisirCouleurDessin(CouleurParComposante(255, 0, 0));
|
||||
for (i = 0; i < 5; i++) {
|
||||
RemplirRectangle(pommex[i], pommey[i], TAILLE_CELLULE, TAILLE_CELLULE);
|
||||
}
|
||||
}
|
||||
|
||||
int collisionAvecPomme() {
|
||||
int i;
|
||||
int pommex[5];
|
||||
int pommey[5];
|
||||
for (i = 0; i < 5; i++) {
|
||||
return (serpent.corps[0].x == pommex[i] && serpent.corps[i].y == pommey[i]);
|
||||
for(pp = 0; pp < 5; ++pp){
|
||||
AfficherSprite(pomme, pommex[pp], pommey[pp]);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user