-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchomper.h
25 lines (22 loc) · 830 Bytes
/
chomper.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
#ifndef CHOMPER_H
#define CHOMPER_H
#include "plant.h"
class Chomper : public Plant
{
public:
Chomper(QRect *lawn_tile = 0);
~Chomper();
static int seedingTime; //cool down period after placing a plant
private:
QPixmap *chomperImage; //holds chompher pixmap
QPixmap *chomperEatingImage; //holds chomper eating pixmap
QGraphicsRectItem *collisionRect; //collision mask used to detect zombie
//in chomper's effective range
QTime *resetTimer; //counter used to reset chomper states
bool isEating; //chomper state where chomper is inactive and cannot attack
//Virtual QGraphicsItem functions
QRectF boundingRect() const;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *);
void advance(int phase);
};
#endif // CHOMPER_H