Merge branch 'master' of https://dwarves.iut-fbleau.fr/gitiut/pietrois/SAE11_2022
This commit is contained in:
commit
2f7125ca22
29
grille.c
29
grille.c
@ -1,29 +0,0 @@
|
|||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <time.h>
|
|
||||||
|
|
||||||
int* grille(int taille) {
|
|
||||||
srand(time(NULL));
|
|
||||||
int i,j;
|
|
||||||
int coos[2];
|
|
||||||
int tab[taille][taille] = {};
|
|
||||||
coos[0] = rand()%taille;
|
|
||||||
coos[1] = rand()%taille;
|
|
||||||
for (i=0;i<6;i++){
|
|
||||||
for (j=0;j<6;j++){
|
|
||||||
tab[i][j] = -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (i=0;i<18;i++){
|
|
||||||
for (j=0;j<2;j++){
|
|
||||||
while (tab[coos[0]][coos[1]] != -1){
|
|
||||||
coos[0] = rand()%6;
|
|
||||||
coos[1] = rand()%6;
|
|
||||||
}
|
|
||||||
tab[coos[0]][coos[1]] = i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return tab;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
27
hitboxes.c
27
hitboxes.c
@ -1,27 +0,0 @@
|
|||||||
#include <graph.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
int ZoneRectangle(int upper_x,int upper_y,int lower_x,int lower_y,int pos_x,int pos_y){
|
|
||||||
//upper_x et upper_y sont les coordonnées du point supérieur gauche du rectangle
|
|
||||||
//lower_x et lower_y sont les coordonnées du point inférieur droit du rectangle
|
|
||||||
//La fonction renvoie 1 si la souris est dans la zone et renvoie 0 si elle n'y est pas
|
|
||||||
SourisPosition();
|
|
||||||
int pos_x = _X
|
|
||||||
if ((pos_x <= upper_x && pos_x >= lower_x) && (pos_y <= upper_y && pos_y >= lower_y))
|
|
||||||
return 1;
|
|
||||||
else return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int main(void){
|
|
||||||
int pos_x,pos_y;
|
|
||||||
InitialiserGraphique();
|
|
||||||
CreerFenetre(10,10,1000,1000);
|
|
||||||
RemplirRectangle(10,10,100,100);
|
|
||||||
while(1){
|
|
||||||
if (SourisCliquee())
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
FermerGraphique();
|
|
||||||
return EXIT_SUCCESS;
|
|
||||||
}
|
|
BIN
test_sprite.png
BIN
test_sprite.png
Binary file not shown.
Before Width: | Height: | Size: 106 KiB |
Loading…
Reference in New Issue
Block a user