X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=seascene.h;h=963f3d11a7abdf99239f554575c71add5339cb94;hb=00f6534719b46dd5479cff4d73339c3ce2c36664;hp=a296710c1ac279c7be3aedd585e2c98bfec44a23;hpb=6f8e2c65991b2451bf8a54c7d82fc2a4d6aa63f2;p=ghostsoverboard
diff --git a/seascene.h b/seascene.h
index a296710..963f3d1 100644
--- a/seascene.h
+++ b/seascene.h
@@ -1,7 +1,40 @@
+/**************************************************************************
+ Ghosts Overboard - a game for Maemo 5
+
+ Copyright (C) 2011 Heli Hyvättinen
+
+ This file is part of Ghosts Overboard
+
+ Ghosts Overboard is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+
+**************************************************************************/
+
+
#ifndef SEASCENE_H
#define SEASCENE_H
#include
+#include
+#include "screenlitkeeper.h"
+#include "level.h"
+#include "levelset.h"
+#include
+#include
+#include
+#include
+
+using namespace QtMobility;
class SeaScene : public QGraphicsScene
{
@@ -12,6 +45,12 @@ public:
signals:
void allGhostsPicked();
+ void pauseOn();
+ void pauseOff();
+ void vibrationActivated(bool on);
+ void minimizeRequested();
+ void fullscreenRequested();
+ void deviceJustLocked();
public slots:
@@ -21,7 +60,9 @@ public slots:
@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 setupMap(int ghosts, int rocks, int octopuses, int octopusSpeed);
+
+ void setupMap(Level level);
void spreadGhosts(int ghosts);
@@ -29,6 +70,36 @@ public slots:
void ghostsDropped(int ghosts);
+ void pause (bool paused);
+
+ void vibrationActivate(bool);
+
+ void handleScreenTapped();
+
+ void about();
+
+ void restartLevel();
+
+ void nextLevel();
+
+ void restartGame();
+
+ void forcePause();
+
+ void softContinue();
+
+ void setItemPointersNull();
+
+ void turnPauseOn();
+
+ void handleDeviceLocked(bool isLocked);
+
+ void pollDeviceLocked();
+
+
+
+
+
protected:
/*! Gives a pointer to a random position if a free one is found. Otherwise returns NULL.
@@ -37,6 +108,13 @@ protected:
QPointF* findRandomFreeSlot();
+ void createMenuItems();
+ void prepareForMenu(QGraphicsItem * pItem);
+ void createAboutBoxItems();
+ void createVictoryItems();
+ void createLevelCompletedItems();
+ void createSelectLevelsetFromListItems();
+
const QString ghostImageFilename_;
const QString rockImageFilename_;
const QString octopusImageFilename_;
@@ -48,8 +126,54 @@ protected:
QList movingItems_;
+ bool paused_;
+
+ ScreenLitKeeper screenLitKeeper_;
+
+ int menuItemCount_;
+
+ QGraphicsTextItem * pPausetextItem_;
+
+ QGraphicsTextItem * pRestartLevelItem_;
+ QGraphicsTextItem * pRestartGameItem_;
+ QGraphicsTextItem * pSettingsItem_;
+ QGraphicsTextItem * pAboutItem_;
+ QGraphicsTextItem * pQuitItem_;
+ QGraphicsTextItem * pMinimizeItem_;
+ QGraphicsTextItem * pChooseLevelsetItem_;
+
+ QGraphicsTextItem * pVictoryCongratulationsItem_;
+ QGraphicsTextItem * pVictoryScoreItem_;
+ QGraphicsTextItem * pAboutBoxItem_;
+
+ QGraphicsTextItem * pLevelCompletedItem_;
+
+ QGraphicsTextItem * pSelectLevelsetFromListItem_;
+
+ QList levelsetItems_;
+
+ QList availableLevelsets_;
+
+ Levelset levelset_;
+
+ int currentLevel_;
+
+
+ QAction* pVibrateAction_;
+
+ QAction* pPauseAction_;
+
+ QTimer autopauseTimer;
+
+ QSystemDeviceInfo deviceInfo_;
+
+ bool alreadyLocked_;
+ QTimer deviceLockPollTimer_;
+ QTime scoreCounter_;
+ int totalScore_;
+ int levelScore_;
};