diff options
Diffstat (limited to 'pacman-c++/actor.cpp')
| -rw-r--r-- | pacman-c++/actor.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/pacman-c++/actor.cpp b/pacman-c++/actor.cpp index a52be15..cd59c1e 100644 --- a/pacman-c++/actor.cpp +++ b/pacman-c++/actor.cpp | |||
| @@ -47,7 +47,7 @@ Actor::Actor(Color::Color color, bool local, QGraphicsItem *parent) | |||
| 47 | m_eating.append(setupEatingAnimation(Actor::Down)); | 47 | m_eating.append(setupEatingAnimation(Actor::Down)); |
| 48 | 48 | ||
| 49 | /* setup player */ | 49 | /* setup player */ |
| 50 | connect(AudioPlayer::self(), SIGNAL(finished()), this, SLOT(enqueue())); | 50 | connect(AudioPlayer::self(), SIGNAL(aboutToFinish()), this, SLOT(enqueue())); |
| 51 | 51 | ||
| 52 | /* make the picture showing the current direction visible */ | 52 | /* make the picture showing the current direction visible */ |
| 53 | m_images[m_direction]->setVisible(true); | 53 | m_images[m_direction]->setVisible(true); |
| @@ -155,7 +155,9 @@ void Actor::move(Actor::Movement direction) | |||
| 155 | if (direction == Actor::None) | 155 | if (direction == Actor::None) |
| 156 | m_images[m_direction]->setVisible(true); | 156 | m_images[m_direction]->setVisible(true); |
| 157 | else | 157 | else |
| 158 | { | ||
| 158 | m_eating[direction]->start(); | 159 | m_eating[direction]->start(); |
| 160 | } | ||
| 159 | m_direction = direction; | 161 | m_direction = direction; |
| 160 | } | 162 | } |
| 161 | 163 | ||
| @@ -163,7 +165,10 @@ void Actor::move(Actor::Movement direction) | |||
| 163 | { | 165 | { |
| 164 | m_moving->start(); | 166 | m_moving->start(); |
| 165 | if (m_local && AudioPlayer::self()->state() != Phonon::PlayingState) | 167 | if (m_local && AudioPlayer::self()->state() != Phonon::PlayingState) |
| 168 | { | ||
| 166 | AudioPlayer::self()->play(AudioPlayer::WakaWaka); | 169 | AudioPlayer::self()->play(AudioPlayer::WakaWaka); |
| 170 | AudioPlayer::self()->enqueue(AudioPlayer::WakaWaka); | ||
| 171 | } | ||
| 167 | } | 172 | } |
| 168 | } | 173 | } |
| 169 | 174 | ||
