-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathPlayerStatus.hpp
More file actions
46 lines (38 loc) · 1.18 KB
/
Copy pathPlayerStatus.hpp
File metadata and controls
46 lines (38 loc) · 1.18 KB
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
#pragma once
//---------------------------------------------------------------------------------
// Written by Terence J. Grant - tjgrant [at] tatewake [dot] com
// Find the full tutorial at: http://gamedev.tutsplus.com/series/
//----------------------------------------------------------------------------------
class PlayerStatus
: public tSingleton<PlayerStatus>
{
protected:
static const float kMultiplierExpiryTime;
static const int kMaxMultiplier;
static const std::string kHighScoreFilename;
float mMultiplierTimeLeft;
int mLives;
int mScore;
int mHighScore;
int mMultiplier;
int mScoreForExtraLife;
uint32_t mLastTime;
protected:
int LoadHighScore();
void SaveHighScore(int score);
protected:
PlayerStatus();
public:
void reset();
void update();
void addPoints(int basePoints);
void increaseMultiplier();
void resetMultiplier();
void removeLife();
int getLives() const;
int getScore() const;
int getHighScore() const;
int getMultiplier() const;
bool getIsGameOver() const;
friend class tSingleton<PlayerStatus>;
};