#include <graphics.h>
#include <conio.h>
#include <math.h>
#include <stdio.h>
#include "EasyXPng.h"
#define high 800//画面大小
#define width 600
#pragma comment(lib,"Winmm.lib")
IMAGE img_background;//背景
IMAGE img_player1;
float plane_x, plane_y;//我机位置
float bullet_x,bullet_y;//子弹位置
float enemy_x,enemy_y;//敌机位置z
float boss_x,boss_y;//boss位置
int islive=0;//飞机状态
int score=0;//得分
void startup()
{
initgraph (width,high);
loadimage(&img_player1,L".\\Player1.png");
loadimage(&img_background,L".\\background.jfif");
BeginBatchDraw();
plane_x=width*0.5;
plane_y=high*0.5;
BeginBatchDraw();
}
void aboutplane()
{
MOUSEMSG m;// 定义鼠标消息
while (MouseHit()) // 检测当前是否有鼠标消息
{
m = GetMouseMsg();
if(网页链接 == WM_MOUSEMOVE) // 到鼠标移动时
{
plane_x=m.x;
plane_y=m.y;// 飞机的位置等于鼠标所在的位置
}
else if(网页链接 == WM_LBUTTONDOWN)
{
bullet_x=plane_x;//子弹位置
bullet_y=plane_y;
}
}
}
void show()
{
putimage(plane_x-50,plane_y-50,&img_player1);
putimage(0,0,&img_background);
}
int main()
{
startup();
while(1)
{
aboutplane();
show();
}
return 0;
}
望各位大佬指点一二,跪谢
#include <conio.h>
#include <math.h>
#include <stdio.h>
#include "EasyXPng.h"
#define high 800//画面大小
#define width 600
#pragma comment(lib,"Winmm.lib")
IMAGE img_background;//背景
IMAGE img_player1;
float plane_x, plane_y;//我机位置
float bullet_x,bullet_y;//子弹位置
float enemy_x,enemy_y;//敌机位置z
float boss_x,boss_y;//boss位置
int islive=0;//飞机状态
int score=0;//得分
void startup()
{
initgraph (width,high);
loadimage(&img_player1,L".\\Player1.png");
loadimage(&img_background,L".\\background.jfif");
BeginBatchDraw();
plane_x=width*0.5;
plane_y=high*0.5;
BeginBatchDraw();
}
void aboutplane()
{
MOUSEMSG m;// 定义鼠标消息
while (MouseHit()) // 检测当前是否有鼠标消息
{
m = GetMouseMsg();
if(网页链接 == WM_MOUSEMOVE) // 到鼠标移动时
{
plane_x=m.x;
plane_y=m.y;// 飞机的位置等于鼠标所在的位置
}
else if(网页链接 == WM_LBUTTONDOWN)
{
bullet_x=plane_x;//子弹位置
bullet_y=plane_y;
}
}
}
void show()
{
putimage(plane_x-50,plane_y-50,&img_player1);
putimage(0,0,&img_background);
}
int main()
{
startup();
while(1)
{
aboutplane();
show();
}
return 0;
}
望各位大佬指点一二,跪谢