-
Notifications
You must be signed in to change notification settings - Fork 1
/
Player.h
46 lines (39 loc) · 940 Bytes
/
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
//
// Created by nikang on 1/30/17.
//
#ifndef PLAYER_H
#define PLAYER_H
#include"Object.h"
#include <QKeyEvent>
#include <QtMultimedia/qsound.h>
#include "game.h"
#include "DepotFuel.h"
#include"fuelindicator.h"
class Game;
class Object;
class Player : public Object{
private:
Game* game;
static int height;
static int width;
int direction;
bool upKeyPushed;
bool downKeyPushed;
bool rightKeyPushed;
bool leftKeyPushed;
bool hasBullet;
FuelIndicator * fuel;
QSound sound;
public:
virtual void advance(int phase);
Player(FuelIndicator* fuel , Game* game, double vX, double aX);
void keyPressEvent(QKeyEvent * event);
void keyReleaseEvent(QKeyEvent * event);
virtual void explode();
void setHasBullet(bool value);
static int getHeight();
static void setHeight(int value);
static int getWidth();
static void setWidth(int value);
};
#endif //MAINJET_H