4 Ship::Ship(QPixmap pixmap, QGraphicsItem *parent) :
5 OrientationControlledGraphicsPixmapObject(pixmap,parent)
11 bool Ship::handleCollisions()
13 QList<QGraphicsItem*> collidesList = collidingItems();
15 if (collidesList.isEmpty())
20 //since the game logic does not leave items to collide with each other we can take just the topmost one
21 //and trust it is the only one
22 QString type = collidesList.at(0)->data(0).toString();
25 if (type == "rock" || type == "octopus")
27 // drop all ghosts when hitting an obstacle
28 emit droppingGhosts(ghostsAboard_);
34 else if (type == "ghost")
38 qDebug() << ghostsAboard_ << " ghosts aboard";
40 emit pickingGhost(collidesList.at(0));