summaryrefslogtreecommitdiffstats
path: root/pacman-c++/actor.cpp
diff options
context:
space:
mode:
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)