From bbd2a69a962d15f74a4afcb7b66462eac9fa5008 Mon Sep 17 00:00:00 2001 From: manuel Date: Wed, 20 Apr 2011 02:19:08 +0200 Subject: 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 --- pacman-c++/actor.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'pacman-c++/actor.cpp') 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 } Actor::Actor(Color::Color color, bool local, QGraphicsItem *parent) - : GameEntity(color, parent),m_direction(Actor::None), m_local(local), + : GameEntity(color, parent), m_direction(Actor::None), m_local(local), m_wakaPlayer(NULL), m_roundPoints(0), m_gamePoints(0) { m_type = Type; @@ -112,6 +112,15 @@ bool Actor::isLocal() return m_local; } +void Actor::resetDirection() +{ + /* hide all pictures */ + for (int i = 0; i < m_images.size(); ++i) + m_images.at(i)->setVisible(false); + m_direction = Actor::None; + m_images[m_direction]->setVisible(true); +} + void Actor::move(Actor::Movement direction) { if (Constants::server) -- cgit v1.2.3