-
Notifications
You must be signed in to change notification settings - Fork 20
/
ghost.h
42 lines (39 loc) · 1.17 KB
/
ghost.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
42
#ifndef GHOST_H
#define GHOST_H
#include "pacman.h"
class Ghost : public QObject, public QGraphicsPixmapItem
{
Q_OBJECT
protected:
int d;
int i_pos;
int j_pos;
int i_x;
int i_y;
int flag;
int i_exit;
int j_exit;
int direction;
int map_path[size_x][size_y];
int x_dir[4] = { 1, -1, 0, 0 };
int y_dir[4] = { 0, 0, 1, -1 };
PacMan *pacman;
QGraphicsScene *scene;
public:
void ft_clear_map();
void ft_restore_path();
void ft_set_direction();
virtual void ft_find_pacman() = 0;
virtual void ft_find_path() = 0;
int ft_check_intersect();
int ft_set_direction_near();
int ft_get_i_pos();
int ft_get_j_pos();
int ft_check_move(int i_pos, int j_pos);
virtual void ft_set_default() = 0;
virtual void ft_calculate_point() = 0;
Ghost();
public slots:
virtual void ft_move_ghost() = 0;
};
#endif // GHOST_H