-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathash.h
53 lines (44 loc) · 1.06 KB
/
ash.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
/**@file ash.h
* @brief declaration for the ash class
*
* Contains the declarations of the member funcitons.
*/
#ifndef ASH_H
#define ASH_H
#include <QObject>
#include <QGraphicsPixmapItem>
#include <QGraphicsItem>
#include <QLabel>
#include <QPainter>
#include <QKeyEvent>
#include <QTimer>
#include <QMediaPlayer>
/**@class Ash
* This class deals with the player Ash in the game.
* @brief The Ash class constructs the player for the first task and moves an object of type Ash.
*/
class Ash : public QObject, public QGraphicsPixmapItem
{
Q_OBJECT
public:
explicit Ash(QGraphicsItem *parent = 0);
void keyPressEvent(QKeyEvent* event);
void keyReleaseEvent(QKeyEvent* event);
void jump();
bool onSnorlax();
void damaged();
signals:
public slots:
void moveEvent();
void originalPixmap();
private:
QTimer* ash_timer;
double x_velocity = 10;
double y_velocity = 0;
double gravity = 1.2;
bool isJumping = false;
bool moveRight = false;
bool moveLeft = false;
QMediaPlayer* jump_sound;
};
#endif // ASH_H