3 Octopus::Octopus(QPixmap pixmap, int speed, QGraphicsItem *parent) :
4 TimerControlledGraphicsPixmapObject(pixmap,speed,parent)
8 bool Octopus::handleCollisions()
11 QList<QGraphicsItem*> collidesList = collidingItems();
12 if (collidesList.isEmpty())
13 return true; //retain new position
17 //change direction if hit anything
19 //the game allows only one object to saty at given spot, so just check the firs one
20 if (collidesList.at(0)->data(0) == "ship")
22 emit droppingGhosts();
24 return false; //go back to old position