forked from Sicatriz/CppGame
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenemy.h
41 lines (35 loc) · 886 Bytes
/
enemy.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
#ifndef ENEMY_H
#define ENEMY_H
#include <QObject>
#include <QGraphicsItem>
#include <QGraphicsPixmapItem>
#include <QTimer>
#include <QGraphicsScene>
#include <QList>
#include <stdlib.h>
#include "movableObjects.h"
#include "health.h"
#include <QTimer>
/*******************************************/
/*******************************************/
/********** ENEMY ABSTRACT CLASS *********/
/*******************************************/
/*******************************************/
namespace insemi
{
class Enemy: public MovableObjects /***8 abstract base class***/
{
Q_OBJECT // enemy needs to be an Qobject for movement
public:
Enemy(QGraphicsItem * parent=0);
Health* health;
public slots:
// virtual movement class
virtual void move();
void hit(int dmg); /***9 virtual function***/
bool destroy();
protected:
int hp = 1;
};
}
#endif // ENEMY_H