#include <easyx.h>
#include <time.h>
#include <conio.h>
class Bullet;
class Tank;
class E_Bullet;
class Boss;
bool dead = false;
bool wined = false;
struct pos//坐标类
{
int a;
int b;
};
class E_Bullet//敌人打出的子弹
{
public:
clock_t d;
int x;
int y;
bool on = false;
pos show()//画出新的位置
{
setfillcolor(RGB(255, 180, 20));
fillrectangle(x - 5, y - 5, x + 5, y + 5);
return pos{ x,y };
}
pos del()//覆盖原来的位置
{
setfillcolor(0);
setlinecolor(0);
fillrectangle(x - 5, y - 5, x + 5, y + 5);
rectangle(x - 5, y - 5, x + 5, y + 5);
return pos{ x,y };
}
pos move()//左移
{
x -= 3;
return pos{ x,y };
}
};
class Bullet//玩家打出的子弹,同上
{
public:
clock_t d;
int x;
int y;
bool on = false;
pos show()
{
setfillcolor(RGB(150, 180, 210));
fillrectangle(x - 5, y - 5, x + 5, y + 5);
return pos{ x,y };
}
pos del()
{
setfillcolor(0);
setlinecolor(0);
fillrectangle(x - 5, y - 5, x + 5, y + 5);
rectangle(x - 5, y - 5, x + 5, y + 5);
return pos{ x,y };
}
pos move()//右移
{
x += 3;
return pos{ x,y };
}
};
class Boss//敌人
{
public:
bool hurting = false;
clock_t d_hurt;
COLORREF clr = RGB(0, 130, 125);
int x;
int y;
int hp = 100;//生命
clock_t d;//判断举例上一次执行某一函数过了多久
clock_t att_d;
bool angle = false;//方向
pos show()
{
setfillcolor(clr);
fillrectangle(x - 20, y - 40, x + 20, y + 40);
return pos{ x,y };
}
pos del()
{