Untitled

mail@pastecode.io avatar
unknown
plain_text
5 months ago
374 B
2
Indexable
#include "Score.h"

Score::Score() : score(0), highScore(0) {}

void Score::updateScore(int points) {
    score += points;
    if (score > highScore) {
        highScore = score;
    }
}

int Score::getScore() const {
    return score;
}

void Score::setHighScore(int highScore) {
    this->highScore = highScore;
}

int Score::getHighScore() const {
    return highScore;
}
Leave a Comment