1 Star 0 Fork 0

李凌志 / llz

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
521.cpp 1.13 KB
一键复制 编辑 原始数据 按行查看 历史
李凌志 提交于 2019-06-13 23:09 . 521
#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;
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/sanctions/llz.git
git@gitee.com:sanctions/llz.git
sanctions
llz
llz
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891