Updated the web page to reflect release of v.0.2.0
[ghostsoverboard] / seascene.cpp
index b5d19af..764fea9 100644 (file)
@@ -53,7 +53,7 @@ SeaScene::SeaScene(QObject *parent) :
 
 }
 
-void SeaScene::setupMap(int ghosts, int rocks, int octopuses)
+void SeaScene::setupMap(int ghosts, int rocks, int octopuses, int octopusSpeed)
 {
     //empty the map
 
@@ -121,7 +121,7 @@ void SeaScene::setupMap(int ghosts, int rocks, int octopuses)
             break;
 
     QPixmap octopusPixmap (":/pix/tursas.png");
-    Octopus * pOctopus = new Octopus(octopusPixmap,100);
+    Octopus * pOctopus = new Octopus(octopusPixmap,octopusSpeed);
     pOctopus->setData(0,"octopus");
     pOctopus->setPos(*pPosition);
     addItem(pOctopus);
@@ -165,6 +165,7 @@ void SeaScene::setupMap(int ghosts, int rocks, int octopuses)
     addItem(pShip);
     connect(pShip,SIGNAL(pickingGhost(QGraphicsItem*)),this, SLOT(removeGhost(QGraphicsItem*)) );
     connect(pShip,SIGNAL(droppingGhosts(int)),this,SLOT(ghostsDropped(int)));
+    connect(this,SIGNAL(vibrationActivated(bool)),pShip,SLOT(setVibrationActivate(bool)));
     pShip->startMoving();
     movingItems_.append(pShip);
     connect(this,SIGNAL(pauseOn()),pShip,SLOT(stopMoving()));
@@ -176,6 +177,10 @@ void SeaScene::setupMap(int ghosts, int rocks, int octopuses)
     delete pPosition;
 }
 
+void SeaScene::setupMap(Level level)
+{
+    setupMap(level.getNumberOfGhosts(),level.getNumberOfRocks(),level.getNumberOfOctopuses(),level.getOctopusSpeed());
+}
 
 void SeaScene::spreadGhosts(int ghosts)
 {
@@ -308,3 +313,8 @@ void SeaScene::pause(bool paused)
             screenLitKeeper_.keepScreenLit(false);
         }
 }
+
+void SeaScene::vibrationActivate(bool on)
+{
+    emit vibrationActivated(on);
+}