Diffstat (limited to 'noncore/games/kpacman/monster.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/games/kpacman/monster.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/noncore/games/kpacman/monster.h b/noncore/games/kpacman/monster.h new file mode 100644 index 0000000..b5d7f36 --- a/dev/null +++ b/noncore/games/kpacman/monster.h | |||
@@ -0,0 +1,62 @@ | |||
1 | #ifndef MONSTER_H | ||
2 | #define MONSTER_H | ||
3 | |||
4 | #include <stdlib.h> | ||
5 | #include <qpixmap.h> | ||
6 | #include <qwidget.h> | ||
7 | |||
8 | #include "board.h" | ||
9 | |||
10 | enum monsterState { dangerous, harmless, rem, arrested }; | ||
11 | |||
12 | class Monster { | ||
13 | public: | ||
14 | Monster(Board *b, int mid = 0); | ||
15 | void setMaxPixmaps(int maxBody, int maxEyes); | ||
16 | void setArrested(int ticks, int duration); | ||
17 | void setDangerous(int ticks, int IQ); | ||
18 | void setHarmless(int ticks, int hDuration, int wDuration); | ||
19 | void setREM(int ticks); | ||
20 | void setPosition(int pos); | ||
21 | void setPrison(int pos); | ||
22 | void setFreedom(int pos); | ||
23 | void setDirection(int dir); | ||
24 | monsterState state(); | ||
25 | int position(); | ||
26 | int direction(); | ||
27 | int id(); | ||
28 | bool move(); | ||
29 | int body(); | ||
30 | int eyes(); | ||
31 | private: | ||
32 | Board *board; | ||
33 | int ID; // ID of monster (0 = 1st, 1 = 2nd ... 7 = last) | ||
34 | int IQ; // Intelligence of movement (0 = dumb..180 = smart) | ||
35 | |||
36 | monsterState actualState; // The state of the monster | ||
37 | |||
38 | int pauseDuration; // Number of ticks before movement | ||
39 | int pause; // actual ticks before moevment (0 = move) | ||
40 | int dangerousPause; // pause in dangerous-state | ||
41 | |||
42 | int harmlessDuration; // Length of harmless-time in ticks | ||
43 | int harmlessLeft; // rest of the time in harmless-state | ||
44 | int warningDuration; // warningtime before monster get dangerous again | ||
45 | |||
46 | int arrestDuration; // Length of arrest in ticks | ||
47 | int arrestLeft; // time left of arrest | ||
48 | int arrestPause; // pause in arrest-state | ||
49 | |||
50 | int actualDirection; // actual direction of monster | ||
51 | int lastDirection; // last direction, before no movement (X) | ||
52 | int actualPosition; // actual position on board | ||
53 | int lastPosition; // the last position of the monster | ||
54 | int feetPosition; // left, right, left, right, ... | ||
55 | int maxBodyPixmaps; | ||
56 | int maxEyesPixmaps; | ||
57 | int prisonPosition; // where to go, if arrested | ||
58 | int freedomPosition; // where to go, if released from prison | ||
59 | }; | ||
60 | |||
61 | #endif // MONSTER_H | ||
62 | |||