forked from kn0w0n3/Super_Mario
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmushroom.h
45 lines (38 loc) · 863 Bytes
/
mushroom.h
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
* Author: equati0n
* Date: December 2016
*/
#ifndef MUSHROOM_H
#define MUSHROOM_H
#include <QGraphicsItem>
#include <QPixmap>
#include "objecttype.h"
#include <QTimer>
#include <QObject>
#include <typeinfo>
#include <QGraphicsScene>
class Mushroom : public QObject, public QGraphicsItem
{
Q_OBJECT
public:
enum { Type = UserType + mushroomType };
Mushroom(QRectF platformRect, int direction,QGraphicsItem *parent = 0);
~Mushroom();
QRectF boundingRect() const;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
int type() const;
public slots:
void nextFrame();
signals:
void marioSizeStatus(int);
private:
int mCurrentFrame;
QPixmap mPixmap;
QRectF mPlatform;
int mDirection;
bool up;
bool right;
bool down;
bool right2;
};
#endif // MUSHROOM_H