-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplayer.h
56 lines (41 loc) · 1.22 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
54
55
#ifndef PLAYER_H
#define PLAYER_H
#include <QObject>
#include <QGraphicsRectItem>
#include <QDebug>
#include <QBrush>
#include "playfield.h"
#include "defines.h"
#define PLAYER_SIZE_X (16 * GAMESCALE_FACTOR)
#define PLAYER_SIZE_Y (16 * GAMESCALE_FACTOR)
#define PLAYER_MIDDLE_X(x) (x + (PLAYER_SIZE_X/2))
#define PLAYER_MIDDLE_Y(x) (x + (PLAYER_SIZE_Y/2))
#define MOVE_PIXELS (4 * GAMESCALE_FACTOR)
class Player :public QGraphicsRectItem
{
public:
Player(Playfield *field, int X, int Y, QBrush brush);
~Player(){};
void move(int X, int Y);
void move(int Key_Up, int Key_Down, int Key_Left, int Key_Right);
int Get_PlayerPos_X();
int Get_PlayerPos_Y();
int Get_MaxBombCount();
int Get_Bombintensity();
int Get_Lives();
Block *getCurrentBlockPosition();
int checkPosition(int X1, int Y1, int X2, int Y2);
int checkPosition(int X1, int Y1);
int checkExpolsion();
void gameLogic(int tick);
void setColor(QBrush brush);
bool Key_Up=0, Key_Down=0, Key_Left=0, Key_Right=0,Key_Bomb=0;
private:
Playfield * playfield;
int x,y;
int bomb_max_count=3, bomb_intensity=3;
int move_interdiction=0;
int lives = 3;
QBrush playerColor;
};
#endif // PLAYER_H