-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplant.h
More file actions
42 lines (28 loc) · 747 Bytes
/
plant.h
File metadata and controls
42 lines (28 loc) · 747 Bytes
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
#ifndef PLANT_H
#define PLANT_H
#include <QPoint>
#include <QSize>
#include <QPixmap>
#include <QObject>
#include<QPainter>
class QPainter;
class Window1;
class QTimer;
class Plant : QObject
{
Q_OBJECT
public:
Plant(QPoint pos, Window1 *game, const QPixmap &sprite = QPixmap(":/Peashooter.gif"));
void draw(QPainter *painter) const;
private slots:
private:
int m_attackRange; // 代表塔可以攻击到敌人的距离
int m_damage; // 代表攻击敌人时造成的伤害
int m_fireRate; // 代表再次攻击敌人的时间间隔
qreal m_rotationSprite;
Window1 * m_game;
const QPoint m_pos;
const QPixmap m_sprite;
static const QSize ms_fixedSize;
};
#endif // PLANT_H