Création des pommes

This commit is contained in:
Matis ROHAUT 2023-11-27 17:29:15 +01:00
parent f29b42874e
commit db76c24baf
2 changed files with 6 additions and 6 deletions

View File

@ -44,7 +44,6 @@ void DessinerScene(){
ChoisirCouleurDessin(CouleurParComposante(255,255,255)); ChoisirCouleurDessin(CouleurParComposante(255,255,255));
EcrireTexte(10,760,timer,2); EcrireTexte(10,760,timer,2);
serpent=ChargerSprite("serpent.png"); serpent=ChargerSprite("serpent.png");
pomme=ChargerSprite("pomme.png");
for (i = 0; i < segment; i++){ for (i = 0; i < segment; i++){
AfficherSprite(serpent, x-(i*20), y); AfficherSprite(serpent, x-(i*20), y);
@ -53,12 +52,13 @@ void DessinerScene(){
old_y[i]=pos_y[i]; old_y[i]=pos_y[i];
old_x[i]=pos_x[i]; old_x[i]=pos_x[i];
} }
srand(time(NULL));
pomme=ChargerSprite("pomme.png");
for (p = 0; p < 5; p++) { for (p = 0; p < 5; p++) {
srand(time(NULL)); pommex = ((rand() % (58)+1)*20);
pommex = (rand() % (58)); pommey = ((rand() % (35)+1)*20);
pommey = (rand() % (35)); AfficherSprite(pomme, pommex, pommey);
AfficherSprite(pomme, pommex*20, pommey*20); printf("%d %d\n", pommex, pommey);
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 608 B

After

Width:  |  Height:  |  Size: 4.2 KiB