-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththing.h
48 lines (42 loc) · 1 KB
/
thing.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
#ifndef THING_H
#define THING_H
#include <QtGui/QMainWindow>
#include <QGraphicsScene>
#include <QGraphicsView>
#include <QGraphicsRectItem>
#include <QTimer>
#include <QTimeLine>
#include <QGraphicsItemAnimation>
#include <QPushButton>
#include <QTextEdit>
#include <QLineEdit>
#include <QListView>
#include <QGraphicsSimpleTextItem>
#include <QGraphicsSceneMouseEvent>
#include <sstream>
#include <time.h>
class GameWindow;
/** This class maintains the image, location, size, and speed of any object in the game. All other objects to display on-screen will inherit from it.*/
class Thing : public QGraphicsPixmapItem
{
public:
Thing(QPixmap &pixmap, int x, int y);
~Thing();
virtual void move() = 0;
bool offscreen;
bool shoots;
int cooldown;
int level;
int health_;
int score;
int random;
void setIntVel(int vx, int vy);
protected:
QGraphicsScene *scene_;
GameWindow *parent_;
double vx_;
double vy_;
int x_;
int y_;
};
#endif // THING_H