}
-void SeaScene::setupMap(int ghosts, int rocks, int octopuses)
+void SeaScene::setupMap(int ghosts, int rocks, int octopuses, int octopusSpeed)
{
//empty the map
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);
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()));
delete pPosition;
}
+void SeaScene::setupMap(Level level)
+{
+ setupMap(level.getNumberOfGhosts(),level.getNumberOfRocks(),level.getNumberOfOctopuses(),level.getOctopusSpeed());
+}
void SeaScene::spreadGhosts(int ghosts)
{
screenLitKeeper_.keepScreenLit(false);
}
}
+
+void SeaScene::vibrationActivate(bool on)
+{
+ emit vibrationActivated(on);
+}