summaryrefslogtreecommitdiffstats
path: root/examples/statemachine/tankgame/rocketitem.h
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eblomfel@trolltech.com>2009-05-12 14:40:44 (GMT)
committerEskil Abrahamsen Blomfeldt <eblomfel@trolltech.com>2009-05-12 14:42:26 (GMT)
commitd26a56e2d94bea2b5a1135b8336bbeefebf3ba1c (patch)
treec4a6497357266aa6f8bca69aef985a0f4ac5779d /examples/statemachine/tankgame/rocketitem.h
parentcb516fd65149991a2105c545192a52f26a6ab67d (diff)
downloadQt-d26a56e2d94bea2b5a1135b8336bbeefebf3ba1c.zip
Qt-d26a56e2d94bea2b5a1135b8336bbeefebf3ba1c.tar.gz
Qt-d26a56e2d94bea2b5a1135b8336bbeefebf3ba1c.tar.bz2
Change name of "errorstate" example to "tankgame"
The error state is not a big enough part of the example to justify naming it after it.
Diffstat (limited to 'examples/statemachine/tankgame/rocketitem.h')
-rw-r--r--examples/statemachine/tankgame/rocketitem.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/examples/statemachine/tankgame/rocketitem.h b/examples/statemachine/tankgame/rocketitem.h
new file mode 100644
index 0000000..189a1dd
--- /dev/null
+++ b/examples/statemachine/tankgame/rocketitem.h
@@ -0,0 +1,26 @@
+#ifndef ROCKETITEM_H
+#define ROCKETITEM_H
+
+#include "gameitem.h"
+
+class RocketItem: public GameItem
+{
+ Q_OBJECT
+public:
+ RocketItem(QObject *parent = 0);
+
+ virtual void idle(qreal elapsed);
+ qreal speed() const { return 100.0; }
+ void setDirection(qreal direction) { m_direction = direction; }
+
+protected:
+ virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
+ QRectF boundingRect() const;
+
+private:
+ qreal m_direction;
+ qreal m_distance;
+};
+
+
+#endif