From 471177aad38350840eed6452b1ad8723b61c330d Mon Sep 17 00:00:00 2001 From: manuel Date: Mon, 4 Apr 2011 14:40:13 +0200 Subject: add more pacmans --- pacman-c++/actor.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'pacman-c++/actor.cpp') diff --git a/pacman-c++/actor.cpp b/pacman-c++/actor.cpp index e98545b..4704ed1 100644 --- a/pacman-c++/actor.cpp +++ b/pacman-c++/actor.cpp @@ -18,9 +18,10 @@ static QVariant myBooleanInterpolator(const bool &start, const bool &end, qreal Actor::Actor(Type type) : m_type(type), m_direction(Actor::None) { - m_pix = ":/" + QString("actor%1").arg(type); - setPixmap(m_pix); + m_pix = ":/" + QString("actor%1").arg(m_type); setSprite(82, 82, SPRITE_PLAYER_WIDTH, SPRITE_PLAYER_HEIGHT); + // higher player "over" lower player + setZValue(m_type * 10); m_direction = Actor::Left; @@ -36,6 +37,7 @@ Actor::Actor(Type type) int x = i * 20 + SPRITE_MARGIN; int y = m_direction * 20 + SPRITE_MARGIN; img->setSprite(x, y, SPRITE_PLAYER_WIDTH, SPRITE_PLAYER_HEIGHT); + img->setZValue(zValue()); img->setVisible(false); img->setPos(QPointF(200, 0)); @@ -50,7 +52,7 @@ Actor::Actor(Type type) fadeout->setEndValue(false); QPropertyAnimation *move = new QPropertyAnimation(img, "pos", moving); - move->setDuration(10000); + move->setDuration(5000); move->setEndValue(QPointF(0, 0)); } -- cgit v1.2.3