-
Notifications
You must be signed in to change notification settings - Fork 20
/
pacman.h
53 lines (49 loc) · 1.49 KB
/
pacman.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
43
44
45
46
47
48
49
50
51
52
53
#ifndef PACMAN_H
#define PACMAN_H
#define WIDTH 608
#define HEIGHT 702
#define size_x 21
#define size_y 19
#include <QObject>
#include <QGraphicsTextItem>
#include <QKeyEvent>
#include <QGraphicsScene>
#include <QGraphicsPixmapItem>
#include <unistd.h>
class PacMan : public QObject, public QGraphicsPixmapItem
{
Q_OBJECT
private:
int i_pos;
int j_pos;
int direction;
int **map_int;
QGraphicsPixmapItem **map_pix;
QGraphicsScene *scene;
QGraphicsTextItem *text;
QGraphicsTextItem *message;
int lives;
void ft_update_scene();
int ft_check_move(int i_pos, int j_pos);
int scared;
int counter;
int score;
int points;
public:
PacMan(int **map_int, QGraphicsPixmapItem **map_pix, QGraphicsScene *scene);
void keyPressEvent(QKeyEvent *event);
int ft_get_pacman_i(void);
void ft_set_defaut();
int ft_get_score();
int ft_scared_state();
void ft_set_scared();
int ft_get_direction();
int ft_get_pacman_j(void);
void ft_incr_score();
void ft_print_score();
void ft_set_lives();
int ft_get_point();
public slots:
void ft_move();
};
#endif // PACMAN_H