summaryrefslogtreecommitdiffstats
path: root/pacman-c++/actor.cpp
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2011-04-12 18:08:02 +0200
committermanuel <manuel@mausz.at>2011-04-12 18:08:02 +0200
commit651a1bee1adc5318922d1b37b0cea11a65df71e2 (patch)
treea60d4921d569f0b4b817e31e049cbc64d11d05f9 /pacman-c++/actor.cpp
parentfae7c3377c8995b217e620c5cf1e963b3ab1e84a (diff)
downloadfoop-651a1bee1adc5318922d1b37b0cea11a65df71e2.tar.gz
foop-651a1bee1adc5318922d1b37b0cea11a65df71e2.tar.bz2
foop-651a1bee1adc5318922d1b37b0cea11a65df71e2.zip
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()
Diffstat (limited to 'pacman-c++/actor.cpp')
-rw-r--r--pacman-c++/actor.cpp9
1 files changed, 2 insertions, 7 deletions
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
10} 10}
11 11
12Actor::Actor(Color::Color color, bool local, QGraphicsItem *parent) 12Actor::Actor(Color::Color color, bool local, QGraphicsItem *parent)
13 : PixmapItem(parent), m_color(color), 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 /* DON'T set any pixmap here. we've a pixmap in the animation 16 /* DON'T set any pixmap here. we've a pixmap in the animation
@@ -102,11 +102,6 @@ QSequentialAnimationGroup *Actor::setupEatingAnimation(Actor::Movement direction
102 return eating; 102 return eating;
103} 103}
104 104
105Color::Color Actor::color()
106{
107 return m_color;
108}
109
110PixmapItem &Actor::icon() 105PixmapItem &Actor::icon()
111{ 106{
112 return m_icon; 107 return m_icon;
@@ -194,7 +189,7 @@ void Actor::move(Actor::Movement direction)
194 if (direction == Actor::None) 189 if (direction == Actor::None)
195 { 190 {
196 qDebug() << "pause"; 191 qDebug() << "pause";
197 m_wakaPlayer->setMuted(true); 192 m_wakaPlayer->pause();
198 } 193 }
199 194
200 m_direction = direction; 195 m_direction = direction;