Octopus speed given can now be zero or less
[ghostsoverboard] / seascene.h
index bfeb5cb..70334e3 100644 (file)
@@ -2,6 +2,7 @@
 #define SEASCENE_H
 
 #include <QGraphicsScene>
+#include "screenlitkeeper.h"
 
 class SeaScene : public QGraphicsScene
 {
@@ -11,15 +12,35 @@ public:
 
 signals:
 
+    void allGhostsPicked();
+    void pauseOn();
+    void pauseOff();
+
 public slots:
 
+    /*! Places all needed items for a level to (re)start.
+    Relies on the scene size to be explicitly set to a a value that will persist troughout play.
+    @param ghosts the number of ghosts to be placed on the map
+    @param rocks the number of rocks to be placed on the map
+    @param octopuses number of octopuses to be placed on the map
+    */
     void setupMap(int ghosts, int rocks, int octopuses);
 
     void spreadGhosts(int ghosts);
 
+    void removeGhost(QGraphicsItem * pGhost);
+
+    void ghostsDropped(int ghosts);
+
+    void pause (bool paused);
+
 protected:
 
-    QPointF findRandomFreeSlot();
+    /*! Gives a pointer to a random position if a free one is found. Otherwise returns NULL.
+        The position is the upper left corner of a free 40x40 pixels slot.
+    */
+
+    QPointF* findRandomFreeSlot();
 
     const QString ghostImageFilename_;
     const QString rockImageFilename_;
@@ -28,6 +49,14 @@ protected:
 
     QList<QPointF> freeTiles_;
 
+    int ghostsLeft_;
+
+    QList<QGraphicsItem*> movingItems_;
+
+    bool paused_;
+
+    ScreenLitKeeper screenLitKeeper_;
+