-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbat.h
More file actions
executable file
·35 lines (32 loc) · 762 Bytes
/
bat.h
File metadata and controls
executable file
·35 lines (32 loc) · 762 Bytes
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
#ifndef BAT_H
#define BAT_H
#include "utils.h"
#include "bullet.h"
#include "monster.h"
class Bat: public Monster{
/*
* Child of Monster, able to fly and shoot bullets.
* If player collides, provide a backwards force and delete the bat.
*/
Q_OBJECT
public:
enum { Type = UserType + 3 };
Bat(QPoint pointA, QPoint PointB, qreal velocity = 2);
public:
int type() const override{
return Type;
}
void update() override;
void nextFrame() override;
void remove() override;
void setupRemove() override;
void fire();
int totalSteps = 0;
int currentSteps = 0;
MonsterBullet *bullet = nullptr;
protected:
void animateRemove() override;
private:
QTimer fireTimer;
};
#endif // BAT_H