summaryrefslogtreecommitdiffstats
path: root/kpacman/fruit.h
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2020-08-17 18:58:43 +0200
committerSlávek Banko <slavek.banko@axis.cz>2020-08-17 18:58:43 +0200
commit6f2c87870081718731cccee678e1e89869826de2 (patch)
tree942f97a4b9d4126d385e8bdc0aee30ff3dc6ed6d /kpacman/fruit.h
downloadtdepacman-6f2c87870081718731cccee678e1e89869826de2.tar.gz
tdepacman-6f2c87870081718731cccee678e1e89869826de2.zip
Initial import of version 0.3.2 from the source package.
https://sourceforge.net/projects/kpacman/files/kpacman/0.3.2/kpacman-0.3.2.tar.gz Original package is licenced under GPL 2.0. Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'kpacman/fruit.h')
-rw-r--r--kpacman/fruit.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/kpacman/fruit.h b/kpacman/fruit.h
new file mode 100644
index 0000000..fbbd9c0
--- /dev/null
+++ b/kpacman/fruit.h
@@ -0,0 +1,53 @@
+#ifndef FRUIT_H
+#define FRUIT_H
+
+#include <stdlib.h>
+
+#include "board.h"
+
+enum fruitState { inactive, active, eaten };
+
+class Fruit {
+public:
+ Fruit(Board *b);
+ void setEaten(int duration);
+ void setLevel(int level, int wDuration, int fDuration, int ticks = -1);
+ void setMaxPixmaps(int max);
+ void setMovement(int entry, int tunnel, int iq);
+ void setPosition(int pos);
+ void setDirection(int dir);
+ fruitState state();
+ int position();
+ int direction();
+ bool move(bool activate=FALSE);
+ int pix();
+
+private:
+ Board *board;
+
+ int IQ; // Intelligence of movement (0 = dumb..180=smart)
+
+ fruitState actualState; // the state of fruit
+
+ int pauseDuration; // number of ticks before next movement
+ int pause; // actual ticks before movement (0 = move)
+
+ int timeLeft; // Ticks remaining of current state
+
+ int waitDuration; // Time before fruit appears
+ int fruitDuration; // Length of active-time in ticks
+
+ int actualDirection; // actual direction of the fruit
+ int actualPosition; // actual position on board
+ int lastPosition; // the last position of the fruit
+ int actualLevel; // level for kind of fruit and score
+ int actualPix;
+ int maxPixmaps; // Number of Pixmaps (1..)
+
+ int entryPosition; // where to come in
+ int homePosition; // where to go, on the way in
+ int tunnelPosition; // where to exit
+};
+
+#endif // FRUIT_H
+