summaryrefslogtreecommitdiff
path: root/noncore/games/kpacman/fruit.h
Unidiff
Diffstat (limited to 'noncore/games/kpacman/fruit.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/kpacman/fruit.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/noncore/games/kpacman/fruit.h b/noncore/games/kpacman/fruit.h
new file mode 100644
index 0000000..fbbd9c0
--- a/dev/null
+++ b/noncore/games/kpacman/fruit.h
@@ -0,0 +1,53 @@
1#ifndef FRUIT_H
2#define FRUIT_H
3
4#include <stdlib.h>
5
6#include "board.h"
7
8enum fruitState { inactive, active, eaten };
9
10class Fruit {
11public:
12 Fruit(Board *b);
13 void setEaten(int duration);
14 void setLevel(int level, int wDuration, int fDuration, int ticks = -1);
15 void setMaxPixmaps(int max);
16 void setMovement(int entry, int tunnel, int iq);
17 void setPosition(int pos);
18 void setDirection(int dir);
19 fruitState state();
20 int position();
21 int direction();
22 bool move(bool activate=FALSE);
23 int pix();
24
25private:
26 Board *board;
27
28 int IQ; // Intelligence of movement (0 = dumb..180=smart)
29
30 fruitState actualState; // the state of fruit
31
32 int pauseDuration; // number of ticks before next movement
33 int pause; // actual ticks before movement (0 = move)
34
35 int timeLeft; // Ticks remaining of current state
36
37 int waitDuration; // Time before fruit appears
38 int fruitDuration; // Length of active-time in ticks
39
40 int actualDirection; // actual direction of the fruit
41 int actualPosition; // actual position on board
42 int lastPosition; // the last position of the fruit
43 int actualLevel; // level for kind of fruit and score
44 int actualPix;
45 int maxPixmaps; // Number of Pixmaps (1..)
46
47 int entryPosition; // where to come in
48 int homePosition; // where to go, on the way in
49 int tunnelPosition; // where to exit
50};
51
52#endif // FRUIT_H
53