#include <STDIO.H>
#include <graphics.h>
#include <CONIO.H>
int main()
{
int x=250;
int y=50;
initgraph(1000,500);
IMAGE img_bk;
int left_i=0;
int right_i=0;
char input;
loadimage(&img_bk,"D:\\resources3\\hmwalk.jpg");
putimage(x,y,75,130,&img_bk,0,0);
BeginBatchDraw();
while (1)
{
if (kbhit())
{
input = getch();
if (input == 'a')
{
clearrectangle(x,y,x+75,y+130);
left_i++;
putimage(x,y,75,130,&img_bk,left_i*75,0);
x = x-10;
FlushBatchDraw();
Sleep(1);
if (left_i==3)
left_i=0;
}
else if (input == 'd' )
{
clearrectangle(x,y,x+75,y+130);
right_i++;
putimage(x,y,75,130,&img_bk,right_i*75,120);
x = x+10;
FlushBatchDraw();
Sleep(1);
if (right_i==3)
right_i=0;
}
}
FlushBatchDraw();
}
EndBatchDraw();
return 0;
}
c语言——easyx human_walk2.0源码
最新推荐文章于 2023-08-05 23:36:02 发布

2195

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



