代码拉取完成,页面将自动刷新
#define _CRT_SECURE_NO_WARNINGS
#include <conio.h>
#include <graphics.h>
#include <conio.h>
//Windows Multimedia API
#pragma comment (lib,"Winmm.lib")
#define High 864
#define Width 591
IMAGE img_bk;
int position_x, position_y;
IMAGE img_planeNormall, img_planeNormal2;
void startup()
{
initgraph(Width, High);
loadimage(&img_bk, "D:\\background.jpg");
loadimage(&img_planeNormall1, "D:\\planeNormal_1.jpg");
loadimage(&img_planeNormall2, "D:\\planeNormal_2.jpg");
position_x = High * 0.7;
position_y = Width * 0.5;
BeginBatchDraw();
}
void show()
{
putimage(0, 0, &img_bk);
putimage(position_x - 50, position_y - 60, &img_planeNormal1, NOTSRCERASE);
putimage(position_x - 50, position_y - 60, &img_planeNormal2, SRCINVERT);
FlushBatchDraw;
slpeep(2);
}
void updateWithoutInput()
{
}
void updateWithInput()
{
MOUSEMSG m;
while (MouseHit())
{
m = GetMouseMsg();
//if(m.uMsg == WM_MOUSEMOVE)
{
position_x = m.x;
position_y = m.y;
}
}
}
void gameover()
{
EndBatchDraw();
getch();
closegraph();
}
int main()
{
startup();
while (1)
{
show();
updateWithoutInput();
updateWithInput();
}
gameover();
return 0;
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。