-
Notifications
You must be signed in to change notification settings - Fork 0
/
arrow.h
47 lines (41 loc) · 981 Bytes
/
arrow.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
#ifndef ARROW_H
#define ARROW_H
#include <QObject>
#include <QGraphicsPixmapItem>
#include "switch.h"
#include <QSoundEffect>
/**
@class Arrow
@brief The Arrow class represents the projectiles the player uses.
The Arrow class publicly derives from the QObject and QGraphicsPixmapItem classes.
*/
class Arrow : public QObject, public QGraphicsPixmapItem
{
Q_OBJECT
public:
/**
* @brief Arrow constructor
* @param value is an integer that determines the direction the arrow is fired
*
* value == 0 for up motion \n
* value == 1 for down motion \n
* value == 2 for left motion \n
* value == 3 for right motion \n
*/
Arrow(int value);
/**
* @brief Arrow deconstructor
*/
~Arrow();
public slots:
/**
* @brief move is a function that controls motion of the player
*/
void move();
private:
int direction;
bool fire;
int speed;
QSoundEffect* effect;
};
#endif // ARROW_H