-
Notifications
You must be signed in to change notification settings - Fork 0
/
car.h
25 lines (22 loc) · 848 Bytes
/
car.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 CAR_H
#define CAR_H
#include "movingobject.h"
class Car : public movingObject {
public:
/** A constructor to set a pointer to the mainWindow, the proper image files, position, and direction */
Car(MainWindow* m, QPixmap *pm, QPixmap *pm2, int nx, int ny, int d);
/** A method to move the car in the proper direction at the proper time */
void move(int timer);
/** A method to determine if the car is colliding with the given TreasureHunter */
bool collide(TreasureHunter *th);
/** A method to animate the car at the proper time */
void animate(int timer);
private:
/** a tracker for direction */
int direction;
/** a helper value to keep track of what stage of animation the car is in */
int animation;
/** A pointer to the car's second QPixmap image */
QPixmap *c2;
};
#endif