-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenemy.h
89 lines (68 loc) · 1.69 KB
/
enemy.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/*
* 包含敌军的图片
* 以及敌军的类
*/
#include <iostream>
#include <SDL_image.h>
#include <SDL.h>
#ifndef START_ENEMY_H
#define START_ENEMY_H
#define Total 1 //敌军类总数
#define Enemy1_pic 6
enum State {
IN,
OUT
};
enum Enemy_Type {
Enemy1
};
std::string DevilPicture[Enemy1_pic] = {
R"(..\image\eneR1.png)",
R"(..\image\eneR2.png)",
R"(..\image\eneR3.png)",
R"(..\image\eneR4.png)",
R"(..\image\enes.png)",
R"(..\image\ened.png)"
};
SDL_Texture *DevilTexture[Enemy1_pic];
//std::string *Picture_Paths[Total] = {DevilPicture};
//SDL_Texture **Enemy_Textures[Total] = {DevilTexture};
class Enemy {
public:
Enemy(int n);
// const SDL_Rect FigSize = {0, 0, 35, 30}; //敌军图片大小
//Maximum axis velocity of the dot
float VEL = 1; //因为逻辑问题,现在它实际上是个平方
// ~Enemy();
void move(struct circle Circle); //敌军移动
void move_control();
void render(); //显示刷新
virtual void death(); //去世操作
bool overline(State state);
int Health{};
SDL_Rect Pos{}; //位置
double Distance_Covered = 0;
bool dying = false;
SDL_Point Center{};
private:
int circle_num = 0;
bool in_circle = false; //是否进入圆范围内
bool exiting_circle = false;
bool flat_overed = false;
double judgement = 0;
protected:
int PicOrder = 0;
double VelX{}, VelY=0; //速度
double X{}, Y{};
int Picture_max{};
SDL_Texture **Texture_Set{};
int life_cost=1;
};
class Enemy1 : public Enemy {
public:
Enemy1(int n);
void death();
private:
std::string *Texture{};
};
#endif //START_ENEMY_H