-
Notifications
You must be signed in to change notification settings - Fork 0
/
crocodile.h
25 lines (22 loc) · 926 Bytes
/
crocodile.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 CROCODILE_H
#define CROCODILE_H
#include "movingobject.h"
class Crocodile : public movingObject {
public:
/** A constructor to set a pointer to the parent mainWindow, pointers to the required images, position, and direction */
Crocodile(MainWindow* m, QPixmap *pm, QPixmap *c, int nx, int ny, int d);
/** A method to move the crocodile at the proper time in the proper direction */
void move(int timer);
/** A method to determine if the crocodile is colliding with the given TreasureHunter */
bool collide(TreasureHunter *th);
/** A method to animate the crocodile at the proper time */
void animate(int timer);
private:
/** A tracker for direction */
int direction;
/** A tracker for the state of animation the crocodile is currently in */
int animation;
/** A pointer to the crocodile's image for its second state of animation */
QPixmap *c2;
};
#endif