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)
{
--n;
angle=-1*(n*step)/R/PI*180;
if((int)(-1*angle)60
#include</

这篇博客展示了如何使用C语言编写动画程序,包括一个运动小车的动画和模拟时钟程序。运动小车动画通过不断改变角度实现动态效果;模拟时钟程序则能够实时更新时间,并在特定时刻发出不同频率的声音提示。
最低0.47元/天 解锁文章
356

被折叠的 条评论
为什么被折叠?



