-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshooter.h
42 lines (39 loc) · 918 Bytes
/
shooter.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
#ifndef SHOOTER_H
#define SHOOTER_H
#include <QObject>
#include <QGraphicsItem>
#include <QPainter>
#include <QPolygon>
#include <QTimer>
#include <QDebug>
#include <QCursor>
#include "target.h"
class Shooter: public Target
{
Q_OBJECT
public:
Shooter(QObject *parent = 0);
~Shooter();
void hit(int damage);
ObjectType getType();
signals:
// void signalBullet(QPointF start, QPointF end, Target * shooter);
void signalDie();
public slots:
void slotTarget(QPointF point);
void slotShot(bool shot);
private slots:
void slotGameTimer();
void slotBulletTimer();
private:
QRectF boundingRect() const;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
QPainterPath shape() const;
QTimer *gameTimer;
QPointF target;
// bool shot;
// QTimer *bulletTimer;
// int health;
// int maxHealth;
};
#endif // SHOOTER_H