Red de conocimiento informático - Material del sitio web - Cómo programar una bola rodante en lenguaje C. Debe ser colorida y rodar.

Cómo programar una bola rodante en lenguaje C. Debe ser colorida y rodar.

#include "graphics.h"

#include "stdlib.h"

main()

{

int i,gdriver,gmode,size,*buf;

gdriver=DETECT;

initgraph(&gdriver,&gmode," ");

setbkcolor(NEGRO);

cleardevice();

setcolor(ROJO CLARO);

setlinestyle(0,0,1);

setfillstyle(1,4);

círculo(100,200,20);

inundaciones(100,200,12);

tamaño=tamañoimagen(79,159,131,231);

buf=malloc(tamaño);

getimage(79,159,131,231,buf);

putimage(530,269,buf,COPY_PUT);

getch();

for(i=0;i<200;i++)

{

putimage(75+i,160,buf,COPY_PUT );

putimage(515-i,160,buf,COPY_PUT);

}

for(i=0;i<200; i++)

{

putimage(270-i,160,buf,COPY_PUT);

putimage(32i,160,buf,COPY_PUT);

}

getch();

closegraph();

}