Upped the version number to 0.2.0
[ghostsoverboard] / seascene.h
1 #ifndef SEASCENE_H
2 #define SEASCENE_H
3
4 #include <QGraphicsScene>
5 #include "screenlitkeeper.h"
6 #include "level.h"
7
8 class SeaScene : public QGraphicsScene
9 {
10     Q_OBJECT
11 public:
12     explicit SeaScene(QObject *parent = 0);
13
14 signals:
15
16     void allGhostsPicked();
17     void pauseOn();
18     void pauseOff();
19     void vibrationActivated(bool on);
20
21 public slots:
22
23     /*! Places all needed items for a level to (re)start.
24     Relies on the scene size to be explicitly set to a a value that will persist troughout play.
25     @param ghosts the number of ghosts to be placed on the map
26     @param rocks the number of rocks to be placed on the map
27     @param octopuses number of octopuses to be placed on the map
28     */
29     void setupMap(int ghosts, int rocks, int octopuses, int octopusSpeed);
30
31     void setupMap(Level level);
32
33     void spreadGhosts(int ghosts);
34
35     void removeGhost(QGraphicsItem * pGhost);
36
37     void ghostsDropped(int ghosts);
38
39     void pause (bool paused);
40
41     void vibrationActivate(bool);
42
43 protected:
44
45     /*! Gives a pointer to a random position if a free one is found. Otherwise returns NULL.
46         The position is the upper left corner of a free 40x40 pixels slot.
47     */
48
49     QPointF* findRandomFreeSlot();
50
51     const QString ghostImageFilename_;
52     const QString rockImageFilename_;
53     const QString octopusImageFilename_;
54     const QStringList shipImageFilenames_;
55
56     QList<QPointF> freeTiles_;
57
58     int ghostsLeft_;
59
60     QList<QGraphicsItem*> movingItems_;
61
62     bool paused_;
63
64     ScreenLitKeeper screenLitKeeper_;
65
66
67
68
69 };
70
71 #endif // SEASCENE_H