Skip to content

Commit

Permalink
show stats on win
Browse files Browse the repository at this point in the history
  • Loading branch information
falseme committed Dec 19, 2023
1 parent 6017f9d commit 900dcde
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 8 additions & 3 deletions CRogue/src/Scene/SceneManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,16 @@ void SceneManager::loadNextLevel() {
return;
}

Player* pl = (Player*)mainScene->find("player");

currentLevel++;
if (currentLevel > MAX_LEVEL)
currentLevel--;
if (currentLevel > MAX_LEVEL) {
pl->saveStats(true, false);
showStats();
loadingNextLevel = false;
return;
}

Player* pl = (Player*)mainScene->find("player");
LevelScene* ls = new LevelScene(currentLevel, mainScene->getAccCamZoom(), pl->getHealth(), pl->getKeyCount(), pl->getPotionCount(), pl->getPotionSmallCount(), pl->getKills());
loadScene(ls);

Expand Down
2 changes: 0 additions & 2 deletions CRogue/src/Scene/StatsScene.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,5 @@ class StatsScene : public Scene {
StatsScene(string title);
void update(Vector2f mousePosition) override;
void loadScene() override;
private:
bool died;
};

0 comments on commit 900dcde

Please sign in to comment.