blob: 6f1a7c1c3efa80b5fa154ebc11ffe5a0b5545110 (
plain)
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
|
#ifndef PACMAN_H
#define PACMAN_H
#include <stdlib.h>
#include <tqpixmap.h>
#include <tqwidget.h>
#include "board.h"
enum pacmanState { alive };
class Pacman {
public:
Pacman(Board *b);
void init(bool Demo = FALSE);
void setMaxPixmaps(int max);
void setAlive(int ticks);
void setPosition(int pos);
void setDirection(int dir, bool forced = FALSE);
void setDemo(bool yes);
pacmanState state();
int position();
int direction();
bool move();
int pix();
private:
Board *board;
pacmanState actualState; // the state of pacman
bool demo; // real life or just demo
int pauseDuration; // number of ticks before next movement
int pause; // actual ticks before movement (0=move)
int actualDirection; // actual direction of pacman
int nextDirection; // where he wants to go
int lastPix; // last Pixmap-index before no movement
int maxPixmaps; // Number of Pixmaps (1..)
int actualPosition; // actual position on board
int lastPosition; // the last position of pacman
int mouthPosition; // eating
};
#endif // PACMAN_H
|