diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2020-08-17 18:58:43 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2020-08-17 18:58:43 +0200 |
commit | 6f2c87870081718731cccee678e1e89869826de2 (patch) | |
tree | 942f97a4b9d4126d385e8bdc0aee30ff3dc6ed6d /kpacman/monster.h | |
download | tdepacman-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/monster.h')
-rw-r--r-- | kpacman/monster.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/kpacman/monster.h b/kpacman/monster.h new file mode 100644 index 0000000..b5d7f36 --- /dev/null +++ b/kpacman/monster.h @@ -0,0 +1,62 @@ +#ifndef MONSTER_H +#define MONSTER_H + +#include <stdlib.h> +#include <qpixmap.h> +#include <qwidget.h> + +#include "board.h" + +enum monsterState { dangerous, harmless, rem, arrested }; + +class Monster { +public: + Monster(Board *b, int mid = 0); + void setMaxPixmaps(int maxBody, int maxEyes); + void setArrested(int ticks, int duration); + void setDangerous(int ticks, int IQ); + void setHarmless(int ticks, int hDuration, int wDuration); + void setREM(int ticks); + void setPosition(int pos); + void setPrison(int pos); + void setFreedom(int pos); + void setDirection(int dir); + monsterState state(); + int position(); + int direction(); + int id(); + bool move(); + int body(); + int eyes(); +private: + Board *board; + int ID; // ID of monster (0 = 1st, 1 = 2nd ... 7 = last) + int IQ; // Intelligence of movement (0 = dumb..180 = smart) + + monsterState actualState; // The state of the monster + + int pauseDuration; // Number of ticks before movement + int pause; // actual ticks before moevment (0 = move) + int dangerousPause; // pause in dangerous-state + + int harmlessDuration; // Length of harmless-time in ticks + int harmlessLeft; // rest of the time in harmless-state + int warningDuration; // warningtime before monster get dangerous again + + int arrestDuration; // Length of arrest in ticks + int arrestLeft; // time left of arrest + int arrestPause; // pause in arrest-state + + int actualDirection; // actual direction of monster + int lastDirection; // last direction, before no movement (X) + int actualPosition; // actual position on board + int lastPosition; // the last position of the monster + int feetPosition; // left, right, left, right, ... + int maxBodyPixmaps; + int maxEyesPixmaps; + int prisonPosition; // where to go, if arrested + int freedomPosition; // where to go, if released from prison +}; + +#endif // MONSTER_H + |