summaryrefslogtreecommitdiffstats
path: root/pacman-c++/actor.cpp
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2011-04-20 02:19:08 +0200
committermanuel <manuel@mausz.at>2011-04-20 02:19:08 +0200
commitbbd2a69a962d15f74a4afcb7b66462eac9fa5008 (patch)
tree17527ce744a9f1c4beb85e953a60f832cdd09068 /pacman-c++/actor.cpp
parent58ba349f19f98fe3af5332188f5d3dfe4d076807 (diff)
downloadfoop-bbd2a69a962d15f74a4afcb7b66462eac9fa5008.tar.gz
foop-bbd2a69a962d15f74a4afcb7b66462eac9fa5008.tar.bz2
foop-bbd2a69a962d15f74a4afcb7b66462eac9fa5008.zip
game rounds finally implemented:
- game rounds will be detected during the round AND - a new map will be send in the NEXT tick to the clients
Diffstat (limited to 'pacman-c++/actor.cpp')
-rw-r--r--pacman-c++/actor.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/pacman-c++/actor.cpp b/pacman-c++/actor.cpp
index cf3fc13..c8922f7 100644
--- a/pacman-c++/actor.cpp
+++ b/pacman-c++/actor.cpp
@@ -10,7 +10,7 @@ static QVariant myBooleanInterpolator(const bool &start, const bool &end, qreal
10} 10}
11 11
12Actor::Actor(Color::Color color, bool local, QGraphicsItem *parent) 12Actor::Actor(Color::Color color, bool local, QGraphicsItem *parent)
13 : GameEntity(color, parent),m_direction(Actor::None), m_local(local), 13 : GameEntity(color, parent), m_direction(Actor::None), m_local(local),
14 m_wakaPlayer(NULL), m_roundPoints(0), m_gamePoints(0) 14 m_wakaPlayer(NULL), m_roundPoints(0), m_gamePoints(0)
15{ 15{
16 m_type = Type; 16 m_type = Type;
@@ -112,6 +112,15 @@ bool Actor::isLocal()
112 return m_local; 112 return m_local;
113} 113}
114 114
115void Actor::resetDirection()
116{
117 /* hide all pictures */
118 for (int i = 0; i < m_images.size(); ++i)
119 m_images.at(i)->setVisible(false);
120 m_direction = Actor::None;
121 m_images[m_direction]->setVisible(true);
122}
123
115void Actor::move(Actor::Movement direction) 124void Actor::move(Actor::Movement direction)
116{ 125{
117 if (Constants::server) 126 if (Constants::server)