summaryrefslogtreecommitdiffstats
path: root/pacman-c++/actor.h
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2011-05-05 00:57:07 +0200
committermanuel <manuel@mausz.at>2011-05-05 00:57:07 +0200
commitce48af53646cd9e7ec762fc1ac176b3aa620b11d (patch)
treef8fbf2cae8c7d0cbac2696a8f4cf94410bfb4928 /pacman-c++/actor.h
parente54ccad07e256ba877bd41d70bd358bd0085bd1e (diff)
downloadfoop-ce48af53646cd9e7ec762fc1ac176b3aa620b11d.tar.gz
foop-ce48af53646cd9e7ec762fc1ac176b3aa620b11d.tar.bz2
foop-ce48af53646cd9e7ec762fc1ac176b3aa620b11d.zip
- refactorized the whole project and made a few subprojects
- replaced tcp with enet - added connect dialog - some smaller bugfixes
Diffstat (limited to 'pacman-c++/actor.h')
-rw-r--r--pacman-c++/actor.h81
1 files changed, 0 insertions, 81 deletions
diff --git a/pacman-c++/actor.h b/pacman-c++/actor.h
deleted file mode 100644
index c30c62a..0000000
--- a/pacman-c++/actor.h
+++ /dev/null
@@ -1,81 +0,0 @@
1#ifndef ACTOR_H
2#define ACTOR_H
3
4#include "gameentity.h"
5#include "constants.h"
6#include "audio.h"
7#include <QtCore/QSequentialAnimationGroup>
8#include <QtCore/QParallelAnimationGroup>
9#include <QList>
10
11class Actor
12 : public GameEntity
13{
14Q_OBJECT
15
16public:
17 enum Movement
18 {
19 None = 0,
20 Left,
21 Right,
22 Up,
23 Down,
24 };
25
26 enum
27 {
28 Type = UserType + Transmission::pacman
29 };
30
31 Actor(Color::Color color, bool local = false, QGraphicsItem *parent = 0);
32 virtual ~Actor()
33 {};
34
35 PixmapItem &icon();
36 const QString iconStr();
37 Movement direction();
38 void setDirection(Movement direction);
39 void reset();
40 bool hadReset();
41 bool isLocal();
42 void move(Movement direction);
43 void move(QPoint newpos);
44 bool isMoving();
45 void die();
46 void eatingFruit();
47 void eatingPacman();
48 void startEating();
49 void stopEating();
50 bool canEat(Actor *other, const QList<Color::Color> &order);
51 virtual void onDie(Actor *);
52
53 unsigned int getRoundPoints();
54 unsigned int getGamePoints();
55 void addRoundPoints(unsigned int amount);
56 void finishRound(bool died = false);
57
58 static QPoint movementToPoint(const Movement direction);
59
60private:
61 void moveByServer(Movement direction);
62 QSequentialAnimationGroup *setupEatingAnimation(Actor::Movement direction);
63
64private:
65 QPixmap m_pix;
66 Movement m_direction;
67 PixmapItem m_icon;
68 bool m_local;
69 bool m_reset;
70 GaplessAudioPlayer *m_wakaPlayer;
71
72 unsigned int m_roundPoints;
73 unsigned int m_gamePoints;
74
75 QList<PixmapItem *> m_images;
76 QList<QSequentialAnimationGroup *> m_eating;
77 QParallelAnimationGroup *m_moving;
78 QSequentialAnimationGroup *m_dieing;
79};
80
81#endif // ACTOR_H