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