forked from kn0w0n3/Super_Mario
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsmallmario.h
57 lines (49 loc) · 1.19 KB
/
smallmario.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
46
47
48
49
50
51
52
53
54
55
56
57
/*
* Author: equati0n
* Date: December 2016
*/
#ifndef SMALLMARIO_H
#define SMALLMARIO_H
#include <QGraphicsItem>
#include <QPixmap>
class SmallMario : public QGraphicsItem
{
public:
SmallMario(QGraphicsItem *parent = 0);
~SmallMario();
int direction() const;
int standingDirection() const;
void addStandingDirection(int standingDirection);
void addDirection(int direction);
void nextFrame();
QRectF boundingRect() const;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
bool isTouchingFoot(QGraphicsItem *item);
bool isTouchingHead(QGraphicsItem *item);
bool isTouchingPlatform(QGraphicsItem *item);
void stand();
void jump();
void standShoot();
void walk();
void fall();
bool isFalling();
private:
enum State {
Standing = 0,
StandShoot,
Walking,
Jumping,
Falling
};
int m_direction;
int mCurrentFrame;
int m_StandingDirection;
State mState;
QPixmap mPixmap;
QPixmap mWalkPixmap;
QPixmap mStandingPixmap;
QPixmap mJumpPixmap;
QPixmap standShootPixmap;
QPixmap mShrinkPixmap;
};
#endif // SMALLMARIO_H