Skip to content

Commit

Permalink
Fix super broken score system
Browse files Browse the repository at this point in the history
  • Loading branch information
albertvaka authored Mar 14, 2024
1 parent 1255cf5 commit 4f5790e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/scene_hellcross.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ HellCrossScene::HellCrossScene()
, scoreText(Assets::font_30)
, bestScoreText(Assets::font_30)
, save("hellcross, 0")
, score(0),
, bestScore(0),
, parallax(map.BoundsInWorld(), Assets::forestParallaxTextures, 0.f, 1.f, -142.1f)
{
MusicPlayer::SetVolume(0.3f);
Expand All @@ -59,7 +61,6 @@ HellCrossScene::HellCrossScene()
}

void HellCrossScene::UpdateScores() {
int oldScore = score;
score = std::max(int((player.pos.x - playerStartPosition.x) / 10), score);
if (score > bestScore) {
bestScore = score;
Expand Down Expand Up @@ -146,6 +147,7 @@ void HellCrossScene::EnterScene()
//skillTree.Enable(Skill::WALLJUMP);
skillTree.Enable(Skill::BREAK);

score = 0;
UpdateScores();

Debug::out << "seed=" << randomSeed << ", bats=" << Bat::GetAll().size();
Expand Down

0 comments on commit 4f5790e

Please sign in to comment.