Skip to content
Snippets Groups Projects
Commit aabd7868 authored by Joshua Alejandro's avatar Joshua Alejandro
Browse files

Added Skeleton for ScoringSystem class

parent ebe06ccd
No related branches found
No related tags found
No related merge requests found
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;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment