diff options
Diffstat (limited to 'pacman-c++')
| -rw-r--r-- | pacman-c++/actor.cpp | 11 | ||||
| -rw-r--r-- | pacman-c++/actor.h | 3 | ||||
| -rw-r--r-- | pacman-c++/audio.cpp | 11 | ||||
| -rw-r--r-- | pacman-c++/audio.h | 7 | ||||
| -rw-r--r-- | pacman-c++/bonuspoint.cpp | 2 | ||||
| -rw-r--r-- | pacman-c++/mainwidget.cpp | 2 | ||||
| -rw-r--r-- | pacman-c++/pacman.qrc | 7 | ||||
| -rw-r--r-- | pacman-c++/sound/ambient.ogg | bin | 0 -> 23243 bytes | |||
| -rw-r--r-- | pacman-c++/sound/die.ogg | bin | 15120 -> 20271 bytes | |||
| -rw-r--r-- | pacman-c++/sound/eating_cherry.ogg | bin | 7015 -> 0 bytes | |||
| -rw-r--r-- | pacman-c++/sound/eating_fruit.ogg | bin | 0 -> 8118 bytes | |||
| -rw-r--r-- | pacman-c++/sound/eating_ghost.ogg | bin | 0 -> 9238 bytes | |||
| -rw-r--r-- | pacman-c++/sound/intermision.ogg | bin | 38875 -> 0 bytes | |||
| -rw-r--r-- | pacman-c++/sound/intro.ogg | bin | 34469 -> 45705 bytes | |||
| -rw-r--r-- | pacman-c++/sound/waka_waka.ogg | bin | 21874 -> 25855 bytes |
15 files changed, 33 insertions, 10 deletions
diff --git a/pacman-c++/actor.cpp b/pacman-c++/actor.cpp index 6ca981c..f56407b 100644 --- a/pacman-c++/actor.cpp +++ b/pacman-c++/actor.cpp | |||
| @@ -216,11 +216,18 @@ void Actor::die() | |||
| 216 | AudioManager::self()->play(Sound::Die); | 216 | AudioManager::self()->play(Sound::Die); |
| 217 | } | 217 | } |
| 218 | 218 | ||
| 219 | void Actor::eatingCherry() | 219 | void Actor::eatingFruit() |
| 220 | { | 220 | { |
| 221 | if (!m_local) | 221 | if (!m_local) |
| 222 | return; | 222 | return; |
| 223 | AudioManager::self()->play(Sound::EatingCherry); | 223 | AudioManager::self()->play(Sound::EatingFruit); |
| 224 | } | ||
| 225 | |||
| 226 | void Actor::eatingPacman() | ||
| 227 | { | ||
| 228 | if (!m_local) | ||
| 229 | return; | ||
| 230 | AudioManager::self()->play(Sound::EatingGhost); | ||
| 224 | } | 231 | } |
| 225 | 232 | ||
| 226 | void Actor::startEating() | 233 | void Actor::startEating() |
diff --git a/pacman-c++/actor.h b/pacman-c++/actor.h index 794f00b..5ec1a59 100644 --- a/pacman-c++/actor.h +++ b/pacman-c++/actor.h | |||
| @@ -33,7 +33,8 @@ public: | |||
| 33 | void move(Movement direction); | 33 | void move(Movement direction); |
| 34 | bool isMoving(); | 34 | bool isMoving(); |
| 35 | void die(); | 35 | void die(); |
| 36 | void eatingCherry(); | 36 | void eatingFruit(); |
| 37 | void eatingPacman(); | ||
| 37 | void startEating(); | 38 | void startEating(); |
| 38 | void stopEating(); | 39 | void stopEating(); |
| 39 | 40 | ||
diff --git a/pacman-c++/audio.cpp b/pacman-c++/audio.cpp index 8726899..6365a15 100644 --- a/pacman-c++/audio.cpp +++ b/pacman-c++/audio.cpp | |||
| @@ -197,6 +197,17 @@ void AudioPlayer::setLoop(Sound::Type sound) | |||
| 197 | setLoop(AudioManager::self()->sound(sound)); | 197 | setLoop(AudioManager::self()->sound(sound)); |
| 198 | } | 198 | } |
| 199 | 199 | ||
| 200 | void AudioPlayer::play() | ||
| 201 | { | ||
| 202 | Phonon::MediaObject::play(); | ||
| 203 | } | ||
| 204 | |||
| 205 | void AudioPlayer::play(Sound::Type sound) | ||
| 206 | { | ||
| 207 | setCurrentSource(Phonon::MediaSource(AudioManager::self()->sound(sound))); | ||
| 208 | play(); | ||
| 209 | } | ||
| 210 | |||
| 200 | /* this is a simple hack to check if phonon can actually play sounds.. */ | 211 | /* this is a simple hack to check if phonon can actually play sounds.. */ |
| 201 | void AudioPlayer::test(QFile *testsound) | 212 | void AudioPlayer::test(QFile *testsound) |
| 202 | { | 213 | { |
diff --git a/pacman-c++/audio.h b/pacman-c++/audio.h index 2e14715..49d29a9 100644 --- a/pacman-c++/audio.h +++ b/pacman-c++/audio.h | |||
| @@ -18,9 +18,10 @@ namespace Sound | |||
| 18 | { | 18 | { |
| 19 | Intro = 0, | 19 | Intro = 0, |
| 20 | WakaWaka, | 20 | WakaWaka, |
| 21 | EatingCherry, | 21 | EatingFruit, |
| 22 | EatingGhost, | ||
| 22 | Die, | 23 | Die, |
| 23 | Siren | 24 | Ambient |
| 24 | }; | 25 | }; |
| 25 | }; | 26 | }; |
| 26 | 27 | ||
| @@ -47,6 +48,8 @@ public: | |||
| 47 | bool isMuted() const; | 48 | bool isMuted() const; |
| 48 | void setLoop(QFile *sound); | 49 | void setLoop(QFile *sound); |
| 49 | void setLoop(Sound::Type sound); | 50 | void setLoop(Sound::Type sound); |
| 51 | void play(); | ||
| 52 | void play(Sound::Type sound); | ||
| 50 | 53 | ||
| 51 | private: | 54 | private: |
| 52 | void test(QFile *testsound); | 55 | void test(QFile *testsound); |
diff --git a/pacman-c++/bonuspoint.cpp b/pacman-c++/bonuspoint.cpp index 221e32e..6e1c9d0 100644 --- a/pacman-c++/bonuspoint.cpp +++ b/pacman-c++/bonuspoint.cpp | |||
| @@ -33,6 +33,6 @@ bool BonusPoint::enter(Actor* actor) | |||
| 33 | 33 | ||
| 34 | void BonusPoint::onDie(Actor *actor) | 34 | void BonusPoint::onDie(Actor *actor) |
| 35 | { | 35 | { |
| 36 | actor->eatingCherry(); | 36 | actor->eatingFruit(); |
| 37 | } | 37 | } |
| 38 | 38 | ||
diff --git a/pacman-c++/mainwidget.cpp b/pacman-c++/mainwidget.cpp index 5ef37e3..e254dbc 100644 --- a/pacman-c++/mainwidget.cpp +++ b/pacman-c++/mainwidget.cpp | |||
| @@ -12,7 +12,7 @@ MainWidget::MainWidget(QWidget *parent) | |||
| 12 | m_sirenPlayer = new AudioPlayer(this); | 12 | m_sirenPlayer = new AudioPlayer(this); |
| 13 | if (m_sirenPlayer->isWorking()) | 13 | if (m_sirenPlayer->isWorking()) |
| 14 | { | 14 | { |
| 15 | m_sirenPlayer->setLoop(Sound::Siren); | 15 | m_sirenPlayer->setLoop(Sound::Ambient); |
| 16 | AudioManager::self()->registerAudioPlayer(m_sirenPlayer); | 16 | AudioManager::self()->registerAudioPlayer(m_sirenPlayer); |
| 17 | } | 17 | } |
| 18 | 18 | ||
diff --git a/pacman-c++/pacman.qrc b/pacman-c++/pacman.qrc index c4b18e6..6654fd1 100644 --- a/pacman-c++/pacman.qrc +++ b/pacman-c++/pacman.qrc | |||
| @@ -23,8 +23,9 @@ | |||
| 23 | <qresource prefix="/sound"> | 23 | <qresource prefix="/sound"> |
| 24 | <file alias="sound1">sound/intro.ogg</file> | 24 | <file alias="sound1">sound/intro.ogg</file> |
| 25 | <file alias="sound2">sound/waka_waka.ogg</file> | 25 | <file alias="sound2">sound/waka_waka.ogg</file> |
| 26 | <file alias="sound3">sound/eating_cherry.ogg</file> | 26 | <file alias="sound3">sound/eating_fruit.ogg</file> |
| 27 | <file alias="sound4">sound/die.ogg</file> | 27 | <file alias="sound4">sound/eating_ghost.ogg</file> |
| 28 | <file alias="sound5">sound/siren.ogg</file> | 28 | <file alias="sound5">sound/die.ogg</file> |
| 29 | <file alias="sound6">sound/ambient.ogg</file> | ||
| 29 | </qresource> | 30 | </qresource> |
| 30 | </RCC> | 31 | </RCC> |
diff --git a/pacman-c++/sound/ambient.ogg b/pacman-c++/sound/ambient.ogg new file mode 100644 index 0000000..2919513 --- /dev/null +++ b/pacman-c++/sound/ambient.ogg | |||
| Binary files differ | |||
diff --git a/pacman-c++/sound/die.ogg b/pacman-c++/sound/die.ogg index 1871e3a..f6af2e0 100644 --- a/pacman-c++/sound/die.ogg +++ b/pacman-c++/sound/die.ogg | |||
| Binary files differ | |||
diff --git a/pacman-c++/sound/eating_cherry.ogg b/pacman-c++/sound/eating_cherry.ogg deleted file mode 100644 index e26c8ce..0000000 --- a/pacman-c++/sound/eating_cherry.ogg +++ /dev/null | |||
| Binary files differ | |||
diff --git a/pacman-c++/sound/eating_fruit.ogg b/pacman-c++/sound/eating_fruit.ogg new file mode 100644 index 0000000..cf17164 --- /dev/null +++ b/pacman-c++/sound/eating_fruit.ogg | |||
| Binary files differ | |||
diff --git a/pacman-c++/sound/eating_ghost.ogg b/pacman-c++/sound/eating_ghost.ogg new file mode 100644 index 0000000..a204a2c --- /dev/null +++ b/pacman-c++/sound/eating_ghost.ogg | |||
| Binary files differ | |||
diff --git a/pacman-c++/sound/intermision.ogg b/pacman-c++/sound/intermision.ogg deleted file mode 100644 index 32c0cc2..0000000 --- a/pacman-c++/sound/intermision.ogg +++ /dev/null | |||
| Binary files differ | |||
diff --git a/pacman-c++/sound/intro.ogg b/pacman-c++/sound/intro.ogg index fa8b3e1..d38f16b 100644 --- a/pacman-c++/sound/intro.ogg +++ b/pacman-c++/sound/intro.ogg | |||
| Binary files differ | |||
diff --git a/pacman-c++/sound/waka_waka.ogg b/pacman-c++/sound/waka_waka.ogg index f499611..def0d96 100644 --- a/pacman-c++/sound/waka_waka.ogg +++ b/pacman-c++/sound/waka_waka.ogg | |||
| Binary files differ | |||
