diff options
Diffstat (limited to 'pacman-c++/main.cpp')
| -rw-r--r-- | pacman-c++/main.cpp | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/pacman-c++/main.cpp b/pacman-c++/main.cpp deleted file mode 100644 index 8c9232a..0000000 --- a/pacman-c++/main.cpp +++ /dev/null | |||
| @@ -1,60 +0,0 @@ | |||
| 1 | #include "actor.h" | ||
| 2 | #include "block.h" | ||
| 3 | |||
| 4 | #include <QtCore> | ||
| 5 | #include <QtGui> | ||
| 6 | #include <phonon/MediaObject> | ||
| 7 | #include <phonon/AudioOutput> | ||
| 8 | #include <phonon/BackendCapabilities> | ||
| 9 | |||
| 10 | int main(int argc, char **argv) | ||
| 11 | { | ||
| 12 | QApplication app(argc, argv); | ||
| 13 | app.setApplicationName("pacman"); | ||
| 14 | |||
| 15 | QGraphicsScene scene(0, 0, 500, 500); | ||
| 16 | scene.setBackgroundBrush(Qt::black); | ||
| 17 | |||
| 18 | Actor *actor1 = new Actor(red); | ||
| 19 | scene.addItem(actor1); | ||
| 20 | actor1->setPos(100, 100); | ||
| 21 | |||
| 22 | Actor *actor2 = new Actor(blue); | ||
| 23 | scene.addItem(actor2); | ||
| 24 | actor2->setPos(120, 100); | ||
| 25 | |||
| 26 | Actor *actor3 = new Actor(green); | ||
| 27 | scene.addItem(actor3); | ||
| 28 | actor3->setPos(140, 100); | ||
| 29 | |||
| 30 | /* | ||
| 31 | Block *block1 = new Block(Actor::Player1); | ||
| 32 | scene.addItem(block1); | ||
| 33 | block1->setPos(200, 200); | ||
| 34 | */ | ||
| 35 | |||
| 36 | for (unsigned int i=0; i<20; ++i) { | ||
| 37 | Block *b = new Block(red); | ||
| 38 | scene.addItem(b); | ||
| 39 | b->setPos( 100 + i*16, 200); | ||
| 40 | } | ||
| 41 | |||
| 42 | QGraphicsView *window = new QGraphicsView(&scene); | ||
| 43 | window->setFrameStyle(0); | ||
| 44 | window->setAlignment(Qt::AlignLeft | Qt::AlignTop); | ||
| 45 | window->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); | ||
| 46 | window->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); | ||
| 47 | |||
| 48 | QMainWindow mainWin; | ||
| 49 | mainWin.setCentralWidget(window); | ||
| 50 | mainWin.resize(500, 500); | ||
| 51 | mainWin.show(); | ||
| 52 | |||
| 53 | Phonon::MediaObject *music = Phonon::createPlayer(Phonon::MusicCategory, | ||
| 54 | Phonon::MediaSource("/home/manuel/uni/foop/pacman-c++/sound/eating_cherry.ogg")); | ||
| 55 | music->play(); | ||
| 56 | |||
| 57 | qsrand(QTime(0,0,0).secsTo(QTime::currentTime())); | ||
| 58 | |||
| 59 | return app.exec(); | ||
| 60 | } | ||
