summaryrefslogtreecommitdiffstats
path: root/examples/statemachine/errorstate/rocketitem.h
blob: 189a1dda313ff826239b551261c073d8da957f64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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