Ecran de veille
omar
-
mimo -
mimo -
voila un ecran de veille sous windows en c et je veux le dévelopé alors merci pour vos commentaire
#include <conio.h>
#include <graphics.h>
#include <stdlib.h>
#include <time.h>
#include <dos.h>
typedef struct
{
int x, y, r;
}
data_s;
/* ---------------------------- */
void initialise (data_s * this)
{
int pilote, mode;
pilote = DETECT;
initgraph (&pilote, &mode, "d:\\bc\\bgi");
this->x = 100;
this->y = 200;
this->r = 50;
circle (this->x, this->y, this->r);
}
/* --------------------------------- */
void deplace_cercle_droite (data_s * this)
{
setcolor (BLACK), circle (this->x, this->y, this->r);
this->x++;
if (this->x == getmaxx ())
this->x = 0;
setcolor (WHITE);
circle (this->x, this->y, this->r);
}
/* --------------------------------- */
void deplace_cercle_gauche (data_s * this)
{
setcolor (BLACK), circle (this->x, this->y, this->r);
if (this->x > 0)
{
this->x--;
}
else
{
this->x = getmaxx () - 1;
}
setcolor (WHITE);
circle (this->x, this->y, this->r);
}
/* --------------------------------- */
void deplace_cercle_haut (data_s * this)
{
setcolor (BLACK), circle (this->x, this->y, this->r);
if (this->y > 0)
{
this->y--;
}
else
{
this->y = getmaxy () - 1;
}
setcolor (WHITE);
circle (this->x, this->y, this->r);
}
/* --------------------------------- */
void deplace_cercle_bas (data_s * this)
{
setcolor (BLACK), circle (this->x, this->y, this->r);
this->y++;
if (this->y == getmaxy ())
this->y = 0;
setcolor (WHITE);
circle (this->x, this->y, this->r);
}
/* --------------------------------- */
int main (void)
{
data_s data;
randomize ();
initialise (&data);
for (;;)
{
if (kbhit ())
{
int touche = getch ();
if (touche == 27)
{
break;
}
}
delay (10);
{
int x = random (4);
switch (x)
{
case 0:
deplace_cercle_droite (&data);
break;
case 1:
deplace_cercle_gauche (&data);
break;
case 2:
deplace_cercle_haut (&data);
break;
case 3:
deplace_cercle_bas (&data);
break;
}
}
}
closegraph ();
return 0;
}
#include <conio.h>
#include <graphics.h>
#include <stdlib.h>
#include <time.h>
#include <dos.h>
typedef struct
{
int x, y, r;
}
data_s;
/* ---------------------------- */
void initialise (data_s * this)
{
int pilote, mode;
pilote = DETECT;
initgraph (&pilote, &mode, "d:\\bc\\bgi");
this->x = 100;
this->y = 200;
this->r = 50;
circle (this->x, this->y, this->r);
}
/* --------------------------------- */
void deplace_cercle_droite (data_s * this)
{
setcolor (BLACK), circle (this->x, this->y, this->r);
this->x++;
if (this->x == getmaxx ())
this->x = 0;
setcolor (WHITE);
circle (this->x, this->y, this->r);
}
/* --------------------------------- */
void deplace_cercle_gauche (data_s * this)
{
setcolor (BLACK), circle (this->x, this->y, this->r);
if (this->x > 0)
{
this->x--;
}
else
{
this->x = getmaxx () - 1;
}
setcolor (WHITE);
circle (this->x, this->y, this->r);
}
/* --------------------------------- */
void deplace_cercle_haut (data_s * this)
{
setcolor (BLACK), circle (this->x, this->y, this->r);
if (this->y > 0)
{
this->y--;
}
else
{
this->y = getmaxy () - 1;
}
setcolor (WHITE);
circle (this->x, this->y, this->r);
}
/* --------------------------------- */
void deplace_cercle_bas (data_s * this)
{
setcolor (BLACK), circle (this->x, this->y, this->r);
this->y++;
if (this->y == getmaxy ())
this->y = 0;
setcolor (WHITE);
circle (this->x, this->y, this->r);
}
/* --------------------------------- */
int main (void)
{
data_s data;
randomize ();
initialise (&data);
for (;;)
{
if (kbhit ())
{
int touche = getch ();
if (touche == 27)
{
break;
}
}
delay (10);
{
int x = random (4);
switch (x)
{
case 0:
deplace_cercle_droite (&data);
break;
case 1:
deplace_cercle_gauche (&data);
break;
case 2:
deplace_cercle_haut (&data);
break;
case 3:
deplace_cercle_bas (&data);
break;
}
}
}
closegraph ();
return 0;
}
A voir également:
- Ecran de veille
- Écran de veille - Guide
- Double ecran - Guide
- Écran de veille gratuit - Télécharger - Thèmes & Fonds d'écran
- Capture d'écran whatsapp - Accueil - Messagerie instantanée
- Retourner ecran pc - Guide
1 réponse
ben si tu fait ca il te faut un compilateur comme ce lui la
http://www.developpez.net/forums/viewforum.php?f=6 si tu le compile tauras un ecran cool pas mal la source
http://www.developpez.net/forums/viewforum.php?f=6 si tu le compile tauras un ecran cool pas mal la source