-
Notifications
You must be signed in to change notification settings - Fork 0
/
Player.h
54 lines (47 loc) · 1.47 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
#pragma once
#include "animatedsprite.h"
#include "Hud.h"
#include "Textures.h"
//Extended from AnimatedSprite, also contains player specific stuff for the player
//TODO: store Variable acceleration? should all sprites have acceleration?
enum ePLAYERSTATE { pUP, pDOWN, pLEFT, pRIGHT };
class Player :
public AnimatedSprite
{
protected:
ePLAYERSTATE mPLAYERSTATE;
bool isLeft;
bool isRight;
bool isUp;
bool isDown;
bool isHealthDisplay;
bool isBatteryDisplay;
int mBatteryLevel;
int mPlayerHealth;
Hud mHud;
public:
Player(void);
Player(
Textures* pTextureHolder,
sf::Vector2f pPosition,
sf::Vector2f pVelocity,
sf::Vector2i pSize,
sf::Texture *pTexture,
float pAngle = 0,
float pAngularVelocity = 0);
virtual ~Player(void);
virtual void draw(sf::RenderWindow *window, float pInterpolation);
void reset();
void update();
void setIsLeft(bool pParam) { isLeft = pParam; }
void setIsRight(bool pParam) { isRight = pParam; }
void setIsUp(bool pParam) { isUp = pParam; }
void setIsDown(bool pParam) { isDown = pParam; }
void setIsHealthDisplay(bool pParam) { isHealthDisplay = pParam; }
void setIsBatteryDisplay(bool pParam) { isBatteryDisplay = pParam; }
ePLAYERSTATE getPlayerState() { return mPLAYERSTATE; }
int getBatterLevel() { return mBatteryLevel; }
int getPlayerHealth() { return mPlayerHealth; }
void setBatteryLevel(int pBatteryLevel) { mBatteryLevel = pBatteryLevel; }
void setPlayerHealth(int pPlayerHealth) { mPlayerHealth = pPlayerHealth; }
};