Merge branch 'levelstructure'
authorHeli Hyvättinen <heli.hyvattinen@kymp.net>
Tue, 5 Jul 2011 15:56:37 +0000 (18:56 +0300)
committerHeli Hyvättinen <heli.hyvattinen@kymp.net>
Tue, 5 Jul 2011 15:56:37 +0000 (18:56 +0300)
Conflicts:
mainwindow.cpp

Multiple levels now supported. 5 levels now.
"Restart game" added to the menu.

1  2 
ghostsoverboard.pro
mainwindow.cpp
mainwindow.h
seascene.cpp
seascene.h

Simple merge
diff --cc mainwindow.cpp
@@@ -71,8 -65,24 +71,25 @@@ MainWindow::MainWindow(QWidget *parent
      connect(pAboutAction,SIGNAL(triggered()),this,SLOT(about()));
      menuBar()->addAction(pAboutAction);
  
+     QAction * pRestartGameAction = new QAction(tr("Restart game"),this);
+     addAction(pRestartGameAction);
+     connect(pRestartGameAction,SIGNAL(triggered()),this,SLOT(restartGame()));
+     menuBar()->addAction(pRestartGameAction);
+     Level level1(5,10);
+     levelList_.append(level1);
+     Level level2(5,10,2,50);
+     levelList_.append(level2);
+     Level level3(5,15,3,50);
+     levelList_.append(level3);
+     Level level4(5,15,5,50);
+     levelList_.append(level4);
+     Level level5(5,15,5,100);
+     levelList_.append(level5);
+     currentLevel_ = 0;
  
 +
      //the boundaries of the scene are set to match the size of the view window, which is not
      //available in the constructor --> timer needed
      QTimer::singleShot(100,this,SLOT(initializeBoundaries()));
diff --cc mainwindow.h
@@@ -44,17 -44,17 +44,19 @@@ public slots
      void restartLevel();
      void about();
      void nextLevel();
+     void restartGame();
  
  
 +
  private:
  
  SeaScene * pScene_;
  QGraphicsView * pView_;
  QAction* pPauseAction_;
+ QList<Level> levelList_;
+ int currentLevel_;
  
 +
  };
  
  #endif // MAINWINDOW_H
diff --cc seascene.cpp
Simple merge
diff --cc seascene.h
Simple merge