diff --git a/app/src/main/java/brickbreaker/ScoringSystem.java b/app/src/main/java/brickbreaker/ScoringSystem.java new file mode 100644 index 0000000000000000000000000000000000000000..d55638f715b02852f09661b9e216f4adcc434478 --- /dev/null +++ b/app/src/main/java/brickbreaker/ScoringSystem.java @@ -0,0 +1,39 @@ +public class ScoringSystem { + private int score; // Current Score + private int highScore; // Highest Score + private static final int POINTS = 1; // Point Value + + public ScoringSystem() { + this.score = 0; + this.highScore = 0; + } + + // Add point to each broken brick + public void brickBroken() { + score += POINTS; + checkForNewHighScore(); + } + + // Compare Current Score and highest score + private void checkForNewHighScore() { + if (score > highScore) { + highScore = score; + } + } + + // Reset score + public void resetScore() { + score = 0; + } + + // Getters + public int getScore() { + return score; + } + + public int getHighScore() { + return highScore; + } +} + +