summaryrefslogtreecommitdiffstats
path: root/pacman-c++/main.cpp
blob: 14a3ee928c13465742e2bc9b0c0d815db29f62dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include "actor.h"
#include <QtCore>
#include <QtGui>

int main(int argc, char **argv)
{
  QApplication app(argc, argv);

  QGraphicsScene scene(0, 0, 500, 500);
  scene.setBackgroundBrush(Qt::black);

  Actor *actor1 = new Actor(Actor::Player1);
  scene.addItem(actor1);
  actor1->setPos(100, 100);

  Actor *actor2 = new Actor(Actor::Player2);
  scene.addItem(actor2);
  actor2->setPos(120, 100);

  Actor *actor3 = new Actor(Actor::Player3);
  scene.addItem(actor3);
  actor3->setPos(140, 100);

  QGraphicsView *window = new QGraphicsView(&scene);
  window->setFrameStyle(0);
  window->setAlignment(Qt::AlignLeft | Qt::AlignTop);
  window->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
  window->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);

  QMainWindow mainWin;
  mainWin.setCentralWidget(window);
  mainWin.resize(500, 500);
  mainWin.show();
  
  qsrand(QTime(0,0,0).secsTo(QTime::currentTime()));

  return app.exec();
}