-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplayer.h
53 lines (44 loc) · 1.06 KB
/
player.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
#ifndef PLAYER_H
#define PLAYER_H
#include "doodlejump.h"
#include "props.h"
#include <QObject>
#include <QGraphicsPixmapItem>
#include <QKeyEvent>
#include <QTimer>
#include <QPixmap>
#include <QMediaPlayer>
#include <QDebug>
class DoodleJump;
class Player:public QObject, public QGraphicsPixmapItem
{
Q_OBJECT
public:
Player(int, int, QTimer *, DoodleJump * = NULL);
void keyPressEvent(QKeyEvent * event);
void keyReleaseEvent(QKeyEvent * event);
void setVel(float = -30);
void start();
void stop();
void shoot();
void hitByMonster();
void reset();
int getStatus();
int getVel();
bool shield, isHit, inHole;
bool left, right, space;
Props * props;
DoodleJump * doodlejump;
public slots:
void move();
void moveEvent();
void hitByHole();
private:
float vel;
int status, count;
QPixmap imgs[3][2], star_imgs[3];
QTimer * timer;
QGraphicsPixmapItem * mouth, * star;
QMediaPlayer * bulletsound, * hitsound;
};
#endif // PLAYER_H