c语言动画程序 代码,求用C语言来设计程序动画

时间:2024-10-11 07:00:40

1。运动的小车动画程序:(tc2。0下运行良好)

#define PI 3。1415926

#define step 10

#define R 10

#include

#include

#include

#include

#include

main()

{

int gdriver=DETECT,gmode;

static int startx=5;

static int starty=100;

int maxx,l=1,n=1;

double dalta=20,angle;

int size;

void *image;

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

cleardevice();

setbkcolor(BLUE);

size=imagesize(startx,starty,startx 60,starty 60);

image=(unsigned char *)malloc(size);

maxx=getmaxx();

while(!kbhit())

{

if(l==1)

{

n ;

angle=-1*(n*step)/PI*180/R;

if((int)(-1*angle)60(maxx-70)/step)

l=0;

}

if(l==0)

{