fixed score display
This commit is contained in:
@ -44,6 +44,13 @@ public:
|
||||
bool toppedOut{false};
|
||||
double fallAcc{0.0};
|
||||
double lockAcc{0.0};
|
||||
int score{0};
|
||||
int lines{0};
|
||||
int level{0};
|
||||
int tetrisesMade{0};
|
||||
int currentCombo{0};
|
||||
int maxCombo{0};
|
||||
int comboCount{0};
|
||||
std::vector<PieceType> bag{}; // 7-bag queue
|
||||
std::mt19937 rng{ std::random_device{}() };
|
||||
};
|
||||
@ -71,11 +78,17 @@ public:
|
||||
bool canHold(PlayerSide s) const { return player(s).canHold; }
|
||||
bool isGameOver() const { return gameOver; }
|
||||
int score() const { return _score; }
|
||||
int score(PlayerSide s) const { return player(s).score; }
|
||||
int lines() const { return _lines; }
|
||||
int lines(PlayerSide s) const { return player(s).lines; }
|
||||
int level() const { return _level; }
|
||||
int level(PlayerSide s) const { return player(s).level; }
|
||||
int comboCount() const { return _comboCount; }
|
||||
int maxCombo() const { return _maxCombo; }
|
||||
int tetrisesMade() const { return _tetrisesMade; }
|
||||
int elapsed() const { return static_cast<int>(elapsedMs / 1000.0); }
|
||||
int elapsed(PlayerSide) const { return elapsed(); }
|
||||
int startLevelBase() const { return startLevel; }
|
||||
double getGravityMs() const { return gravityMs; }
|
||||
double getFallAccumulator(PlayerSide s) const { return player(s).fallAcc; }
|
||||
bool isSoftDropping(PlayerSide s) const { return player(s).softDropping; }
|
||||
@ -113,6 +126,8 @@ private:
|
||||
double gravityGlobalMultiplier{1.0};
|
||||
bool gameOver{false};
|
||||
|
||||
double elapsedMs{0.0};
|
||||
|
||||
std::vector<int> completedLines;
|
||||
|
||||
// Impact FX
|
||||
@ -136,7 +151,7 @@ private:
|
||||
void findCompletedLines();
|
||||
void clearLinesInternal();
|
||||
void updateRowStates();
|
||||
void applyLineClearRewards(int cleared);
|
||||
void applyLineClearRewards(PlayerState& creditPlayer, int cleared);
|
||||
double gravityMsForLevel(int level) const;
|
||||
int columnMin(PlayerSide s) const { return s == PlayerSide::Left ? 0 : 10; }
|
||||
int columnMax(PlayerSide s) const { return s == PlayerSide::Left ? 9 : 19; }
|
||||
|
||||
Reference in New Issue
Block a user