-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathplayer.h
48 lines (47 loc) · 1.16 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
#ifndef PLAYER_H
#define PLAYER_H
#include<QGraphicsItem>
#include<QPoint>
#include<QSound>
#include"weapon.h"
#include"bullet.h"
class Plate;
class Player : public QGraphicsItem
{
public:
Player();
QSound sound1,sound2,sound3;
QPoint position;
QColor head_color;
QColor body_color;
int *keybindings;
int width,height;
int timer;
int abs_time;
int face;
int adjusted_y;
int health;
int remaining_lives;
int plates_num;
int jump_time,max_junp_time;
int want_down_counter;
float x, y, vx, vy, ax, ay;
Bullet *bullets;
Weapon *weapen;
Plate *plates;
bool key_pressed[6];
bool have_jumped;
bool on_ground;
bool want_down;
bool is_apperaed;
bool is_living;
bool is_winner;
QRectF boundingRect() const override;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget*widget) override;
void keyPressEvent(QKeyEvent *event) override;
void keyReleaseEvent(QKeyEvent *event) override;
void update_game();
void print_position();
void initialization(int lives_num);
};
#endif // PLAYER_H