From 6f2c87870081718731cccee678e1e89869826de2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Mon, 17 Aug 2020 18:58:43 +0200 Subject: 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 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Original package is licenced under GPL 2.0. Signed-off-by: Slávek Banko --- kpacman/fruit.h | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 kpacman/fruit.h (limited to 'kpacman/fruit.h') 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 + +#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 + -- cgit v1.2.1