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.cpp8
1 files changed, 5 insertions, 3 deletions
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
18Actor::Actor(Type type) 18Actor::Actor(Type type)
19 : m_type(type), m_direction(Actor::None) 19 : m_type(type), m_direction(Actor::None)
20{ 20{
21 m_pix = ":/" + QString("actor%1").arg(type); 21 m_pix = ":/" + QString("actor%1").arg(m_type);
22 setPixmap(m_pix);
23 setSprite(82, 82, SPRITE_PLAYER_WIDTH, SPRITE_PLAYER_HEIGHT); 22 setSprite(82, 82, SPRITE_PLAYER_WIDTH, SPRITE_PLAYER_HEIGHT);
23 // higher player "over" lower player
24 setZValue(m_type * 10);
24 25
25 m_direction = Actor::Left; 26 m_direction = Actor::Left;
26 27
@@ -36,6 +37,7 @@ Actor::Actor(Type type)
36 int x = i * 20 + SPRITE_MARGIN; 37 int x = i * 20 + SPRITE_MARGIN;
37 int y = m_direction * 20 + SPRITE_MARGIN; 38 int y = m_direction * 20 + SPRITE_MARGIN;
38 img->setSprite(x, y, SPRITE_PLAYER_WIDTH, SPRITE_PLAYER_HEIGHT); 39 img->setSprite(x, y, SPRITE_PLAYER_WIDTH, SPRITE_PLAYER_HEIGHT);
40 img->setZValue(zValue());
39 img->setVisible(false); 41 img->setVisible(false);
40 img->setPos(QPointF(200, 0)); 42 img->setPos(QPointF(200, 0));
41 43
@@ -50,7 +52,7 @@ Actor::Actor(Type type)
50 fadeout->setEndValue(false); 52 fadeout->setEndValue(false);
51 53
52 QPropertyAnimation *move = new QPropertyAnimation(img, "pos", moving); 54 QPropertyAnimation *move = new QPropertyAnimation(img, "pos", moving);
53 move->setDuration(10000); 55 move->setDuration(5000);
54 move->setEndValue(QPointF(0, 0)); 56 move->setEndValue(QPointF(0, 0));
55 } 57 }
56 58