From 651a1bee1adc5318922d1b37b0cea11a65df71e2 Mon Sep 17 00:00:00 2001 From: manuel Date: Tue, 12 Apr 2011 18:08:02 +0200 Subject: make removal of items from scene delayed by one tick (looks better) all items are now derived from gameentity and gameentity is derived from pixmapitem: - this is naturally better - allows us to add a generic gameentity.color() --- pacman-c++/actor.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'pacman-c++/actor.cpp') diff --git a/pacman-c++/actor.cpp b/pacman-c++/actor.cpp index 41de160..d53566e 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) - : PixmapItem(parent), m_color(color), 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) { /* DON'T set any pixmap here. we've a pixmap in the animation @@ -102,11 +102,6 @@ QSequentialAnimationGroup *Actor::setupEatingAnimation(Actor::Movement direction return eating; } -Color::Color Actor::color() -{ - return m_color; -} - PixmapItem &Actor::icon() { return m_icon; @@ -194,7 +189,7 @@ void Actor::move(Actor::Movement direction) if (direction == Actor::None) { qDebug() << "pause"; - m_wakaPlayer->setMuted(true); + m_wakaPlayer->pause(); } m_direction = direction; -- cgit v1.2.3