summaryrefslogtreecommitdiffstats
path: root/pacman-c++/main.cpp
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2011-04-05 01:29:33 +0200
committermanuel <manuel@mausz.at>2011-04-05 01:29:33 +0200
commit4232f8450d896068713d988cf5541835c3818682 (patch)
tree470916a3e1978419d41115eb1e87a0928769e03c /pacman-c++/main.cpp
parent3dba415cd9741874cdaf0781d7e725808c8a2b8d (diff)
downloadfoop-4232f8450d896068713d988cf5541835c3818682.tar.gz
foop-4232f8450d896068713d988cf5541835c3818682.tar.bz2
foop-4232f8450d896068713d988cf5541835c3818682.zip
- we love ogg, we hate mp3/wav
- a lot of coding style/intent fix - add constant.h to pro files
Diffstat (limited to 'pacman-c++/main.cpp')
-rw-r--r--pacman-c++/main.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/pacman-c++/main.cpp b/pacman-c++/main.cpp
index a34ff97..8c9232a 100644
--- a/pacman-c++/main.cpp
+++ b/pacman-c++/main.cpp
@@ -4,6 +4,8 @@
4#include <QtCore> 4#include <QtCore>
5#include <QtGui> 5#include <QtGui>
6#include <phonon/MediaObject> 6#include <phonon/MediaObject>
7#include <phonon/AudioOutput>
8#include <phonon/BackendCapabilities>
7 9
8int main(int argc, char **argv) 10int main(int argc, char **argv)
9{ 11{
@@ -13,22 +15,18 @@ int main(int argc, char **argv)
13 QGraphicsScene scene(0, 0, 500, 500); 15 QGraphicsScene scene(0, 0, 500, 500);
14 scene.setBackgroundBrush(Qt::black); 16 scene.setBackgroundBrush(Qt::black);
15 17
16 Actor *actor1 = new Actor(Actor::Player1); 18 Actor *actor1 = new Actor(red);
17 scene.addItem(actor1); 19 scene.addItem(actor1);
18 actor1->setPos(100, 100); 20 actor1->setPos(100, 100);
19 21
20 Actor *actor2 = new Actor(Actor::Player2); 22 Actor *actor2 = new Actor(blue);
21 scene.addItem(actor2); 23 scene.addItem(actor2);
22 actor2->setPos(120, 100); 24 actor2->setPos(120, 100);
23 25
24 Actor *actor3 = new Actor(Actor::Player3); 26 Actor *actor3 = new Actor(green);
25 scene.addItem(actor3); 27 scene.addItem(actor3);
26 actor3->setPos(140, 100); 28 actor3->setPos(140, 100);
27 29
28 Actor *actor4 = new Actor(Actor::Player4);
29 scene.addItem(actor4);
30 actor4->setPos(160, 100);
31
32 /* 30 /*
33 Block *block1 = new Block(Actor::Player1); 31 Block *block1 = new Block(Actor::Player1);
34 scene.addItem(block1); 32 scene.addItem(block1);
@@ -36,7 +34,7 @@ int main(int argc, char **argv)
36 */ 34 */
37 35
38 for (unsigned int i=0; i<20; ++i) { 36 for (unsigned int i=0; i<20; ++i) {
39 Block *b = new Block(Actor::Player1); 37 Block *b = new Block(red);
40 scene.addItem(b); 38 scene.addItem(b);
41 b->setPos( 100 + i*16, 200); 39 b->setPos( 100 + i*16, 200);
42 } 40 }
@@ -53,7 +51,7 @@ int main(int argc, char **argv)
53 mainWin.show(); 51 mainWin.show();
54 52
55 Phonon::MediaObject *music = Phonon::createPlayer(Phonon::MusicCategory, 53 Phonon::MediaObject *music = Phonon::createPlayer(Phonon::MusicCategory,
56 Phonon::MediaSource("/home/totycro/stud/foop/repo/pacman-c++/sound/intro.wav")); 54 Phonon::MediaSource("/home/manuel/uni/foop/pacman-c++/sound/eating_cherry.ogg"));
57 music->play(); 55 music->play();
58 56
59 qsrand(QTime(0,0,0).secsTo(QTime::currentTime())); 57 qsrand(QTime(0,0,0).secsTo(QTime::currentTime()));