2023-12-20 21:26:34 +01:00
|
|
|
#include <graph.h>
|
|
|
|
#include <stdlib.h>
|
2023-12-21 21:45:49 +01:00
|
|
|
#include "Oeuf.h"
|
|
|
|
#include "time.h"
|
2023-12-20 21:26:34 +01:00
|
|
|
|
|
|
|
void InitialiserOeufs(int oeufx[], int oeufy[], int segment) {
|
|
|
|
int p;
|
|
|
|
int oeuf;
|
|
|
|
for (p = 0; p < 5; p++) {
|
|
|
|
oeufx[p] = ((rand() % (55) + 1) * 20);
|
|
|
|
oeufy[p] = ((rand() % (35) + 1) * 20);
|
|
|
|
ChargerImage("../img/oeuf.png", oeufx[p], oeufy[p],0,0, 20,20);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void Oeuf(int pos_x[], int pos_y[], int oeufx[], int oeufy[], int *segment){
|
|
|
|
int p;
|
|
|
|
int oeuf;
|
|
|
|
for (p = 0; p < 5; p++) {
|
|
|
|
ChargerImage("../img/oeuf.png", oeufx[p], oeufy[p],0,0, 20,20);
|
|
|
|
}
|
|
|
|
for(p=0; p<5; p++){
|
|
|
|
if(oeufx[p]==pos_x[0] && oeufy[p]==pos_y[0]){
|
|
|
|
(*segment) +=2;
|
|
|
|
oeufx[p] = ((rand() % (55)+1)*20);
|
|
|
|
oeufy[p] = ((rand() % (35)+1)*20);
|
2023-12-21 14:32:41 +01:00
|
|
|
Score(*segment);
|
2023-12-20 21:26:34 +01:00
|
|
|
}
|
2023-12-21 14:32:41 +01:00
|
|
|
|
2023-12-20 21:26:34 +01:00
|
|
|
}
|
|
|
|
}
|