aboutsummaryrefslogtreecommitdiff
path: root/src/ActionScene.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ActionScene.h')
-rw-r--r--src/ActionScene.h83
1 files changed, 83 insertions, 0 deletions
diff --git a/src/ActionScene.h b/src/ActionScene.h
new file mode 100644
index 0000000..49fdb20
--- /dev/null
+++ b/src/ActionScene.h
@@ -0,0 +1,83 @@
+#ifndef ActionScene_H
+#define ActionScene_H
+
+#include <QObject>
+#include <QRectF>
+#include <QGraphicsRectItem>
+
+#include "GameScene.h"
+#include "Sprite.h"
+
+#include "map.h"
+#include "mapreader.h"
+#include "orthogonalrenderer.h"
+
+class QGraphicsPixmapItem;
+class Hero;
+
+class ActionScene : public GameScene
+{
+ Q_OBJECT
+
+public:
+ explicit ActionScene(const QString &name, const QRectF &rect, GameView *parent = 0);
+ virtual ~ActionScene();
+
+ void updateLogic();
+ void keyPressEvent(QKeyEvent *event);
+
+ /**
+ * Loads level from target location.
+ */
+ void loadMap(QString target);
+
+private:
+
+ Tiled::Map *m_map;
+ Tiled::MapReader *m_mapReader;
+ Tiled::OrthogonalRenderer *m_mapRenderer;
+
+ //! Level name used for records.
+ QString m_levelName;
+
+ //! Levelscore used for records.
+ int m_levelScore;
+
+ //! Map layer is drawn to this pixmap
+ QPixmap m_mapPixmap;
+
+ //! Item for map layer
+ QGraphicsPixmapItem *m_mapPixmapItem;
+
+ //! What portion of the map to draw
+ QSize m_mapWindow;
+
+ //! Background pixmap
+ QPixmap m_bgPixmap;
+ QGraphicsPixmapItem *m_bgPixmapItem;
+
+ //! What portion of the bg pixmap to draw
+ QRectF m_bgWindow;
+
+ //! Pointer for forwarding commands to main character
+ Hero* m_hero;
+
+ //! Stops graphics rendering while scene is cleared.
+ bool m_clearAlert;
+
+ //! HP text item
+ QGraphicsTextItem* m_hpText;
+ //! Score text item
+ QGraphicsTextItem* m_scoreText;
+
+signals:
+ void gameOver();
+
+public slots:
+ /**
+ * Removes a sprite from the scene
+ */
+ void removeSprite();
+};
+
+#endif // ActionScene_H