-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhero.h
43 lines (36 loc) · 920 Bytes
/
hero.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
#ifndef HERO_H
#define HERO_H
#include "unit.h"
#include "block.h"
#include <QObject>
#include <QMediaPlayer>
class Hero : public Unit
{
Q_OBJECT
public:
explicit Hero(QObject *parent = nullptr, QPixmap pix = QPixmap(":/pics/mario_stop.png"));
~Hero();
QString gameType() override{
return "hero";
}
void playJumpMusic(){
jump_music->play();
}
void move() override;
void jump() override;
void monsterAttackHero(Unit *) override{}
void attack();//todo:implement
void setIsBuffed(bool value);
void beAttacked() override;
bool getIsBuffed() const;
int score = 0;
protected:
void keyPressEvent(QKeyEvent *event) override;
void keyReleaseEvent(QKeyEvent *event) override;
void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
private:
bool isBuffed = false;
QMediaPlayer *jump_music;
signals:
};
#endif // HERO_H