diff options
Diffstat (limited to 'pacman-c++')
| -rw-r--r-- | pacman-c++/mainwidget.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/pacman-c++/mainwidget.cpp b/pacman-c++/mainwidget.cpp index 93fd796..8745bf9 100644 --- a/pacman-c++/mainwidget.cpp +++ b/pacman-c++/mainwidget.cpp | |||
| @@ -154,9 +154,15 @@ void MainWidget::tick() | |||
| 154 | order.append(static_cast<Color::Color>(m_updatepacket.eating_order(i) & Transmission::color_mask)); | 154 | order.append(static_cast<Color::Color>(m_updatepacket.eating_order(i) & Transmission::color_mask)); |
| 155 | m_scene->setEatingOrder(order); | 155 | m_scene->setEatingOrder(order); |
| 156 | 156 | ||
| 157 | /* stop and restart game */ | 157 | /* stop game */ |
| 158 | stopGame(); | 158 | stopGame(); |
| 159 | connect(AudioManager::self()->audioPlayer(), SIGNAL(finished()), this, SLOT(startGame())); | 159 | |
| 160 | /* and restart game */ | ||
| 161 | QTimer *timer = new QTimer(this); | ||
| 162 | timer->setSingleShot(true); | ||
| 163 | timer->setInterval(Sound::length[Sound::Intro] + Constants::tick); | ||
| 164 | connect(timer, SIGNAL(timeout()), this, SLOT(startGame())); | ||
| 165 | timer->start(); | ||
| 160 | AudioManager::self()->play(Sound::Intro, true); | 166 | AudioManager::self()->play(Sound::Intro, true); |
| 161 | } | 167 | } |
| 162 | 168 | ||
