Skip to content

Commit

Permalink
little bug within player's score calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
luut189 committed Jan 29, 2023
1 parent a9c87c5 commit 30b55c9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/dev/kyzel/game/entity/Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,11 @@ public BufferedImage getPlayerImage() {
public int getScore() {
if(currentLevel == 1) return score;

return (currentLevel-1) * maxScoreMultiplier + score;
int result = score;
for(int i = currentLevel - 1; i >= 0; i--) {
result += i * maxScoreMultiplier;
}
return result;
}

/**
Expand Down

0 comments on commit 30b55c9

Please sign in to comment.