-
Notifications
You must be signed in to change notification settings - Fork 0
/
deathknight.h
63 lines (59 loc) · 1.42 KB
/
deathknight.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
#ifndef DEATHKNIGHT_H
#define DEATHKNIGHT_H
#include <QGraphicsRectItem>
#include <QGraphicsPixmapItem>
#include "praetorian.h"
class MainWindow;
/**
* Deathknight enemy class that moves back and forth across
* screen, birthing enemy praetorians.
*/
class Deathknight : public QGraphicsRectItem {
public:
/** Constructor */
Deathknight(double nx, double ny, MainWindow *mw, QGraphicsScene *s);
/** Destructor */
~Deathknight();
/** Change X */
void setX( int x );
/** Change Y */
void setY( int y );
/** Change velocityX */
void setVelocityX( int vx );
/** Change velocityY */
void setVelocityY( int vy );
/** Take away one life */
bool hit();
/** Accessor for X */
int getX();
/** Accessor for Y */
int getY();
/** Accessor for velocityX */
int getVelocityX();
/** Accessor for velocityY */
int getVelocityY();
/** Move the object */
void move(int, int);
private:
/** Coordinate X */
int x;
/** Coordinate Y */
int y;
/** Rect width */
int width;
/** Rect height */
int height;
/** Object's horizontal speed */
int velocityX;
/** Object's vertical speed */
int velocityY;
/** Amount of lives */
int life;
/** Object's image */
QGraphicsPixmapItem *image;
/** Pointer to parent window */
MainWindow *window;
/** Pointer to parent scene */
QGraphicsScene *scene;
};
#endif