其他分享
首页 > 其他分享> > easyX运动简易自行车

easyX运动简易自行车

作者:互联网

int main(void)
{
int x, x1, y1, x2, y2,n;
int bkcolor = WHITE;//背景颜色
initgraph(1200, 1200);//窗口大小
setbkcolor(bkcolor);//窗口颜色
cleardevice();//调用cleardevice,背景色刷新背景
//与x轴有关的线,圆,长方形,进行运动
for (x = 50; x < 1000; x += 10) {
setcolor(BLACK);
setfillcolor(LIGHTGRAY);
x1 = x + 60;
y1 = 370;
x2 = x + 100;
y2 = 375;
n = 5;
setlinestyle(PS_SOLID, n);//设置线的宽度
circle(x, 500, 60);
circle(x, 500, 12);
fillcircle(x, 500, 10);
circle(x + 160, 470, 20);
fillcircle(x + 160, 470, 18);
circle(x + 300, 500, 60);
circle(x + 300, 500, 12);
fillcircle(x + 300, 500, 10);
line(x + 9, 490, x + 142, 470);
line(x + 170, 485, x + 190, 520);
line(x + 185, 520, x + 195, 520);
line(x + 300, 488, x + 280, 420);
line(x + 171, 458, x + 280, 420);
line(x + 280, 420, x + 270, 390);
line(x + 80, 390, x + 270, 390);
line(x + 80, 390, x + 80, 375);
line(x + 12, 490, x + 80, 390);
line(x + 270, 390, x + 250, 350);
line(x + 250, 350, x + 220, 350);
rectangle(x1, y1, x2, y2);//取左上角和右下角的坐标,画长方形
Sleep(50);//延时50ms
setcolor(bkcolor);//擦取之前图像
setfillcolor(bkcolor);
circle(x, 500, 60);
circle(x, 500, 12);
fillcircle(x, 500, 10);
circle(x + 160, 470, 20);
fillcircle(x + 160, 470, 18);
circle(x + 300, 500, 60);
circle(x + 300, 500, 12);
fillcircle(x + 300, 500, 10);
line(x + 9, 490, x + 142, 470);
line(x + 170, 485, x + 190, 520);
line(x + 180, 520, x + 200, 520);
line(x + 300, 488, x + 280, 420);
line(x + 171, 458, x + 280, 420);
line(x + 280, 420, x + 270, 390);
line(x + 80, 390, x + 270, 390);
line(x + 80, 390, x + 80, 375);
line(x + 12, 490, x + 80, 390);
line(x + 270, 390, x + 250, 350);
line(x + 250, 350, x + 220, 350);
rectangle(x1, y1, x2, y2);
}
getchar();
closegraph();
return 0;
}
在这里插入图片描述

标签:80,300,easyX,自行车,简易,390,line,circle,500
来源: https://blog.csdn.net/m0_64375125/article/details/123611517