This commit is contained in:
ackimixs
2024-05-03 14:55:13 +02:00
parent 7ad1f210aa
commit 18b1aa376a
3 changed files with 25 additions and 3 deletions

View File

@@ -41,9 +41,9 @@ InGame::InGame(QWidget *parent) : QWidget(parent) {
connect(this->timer, &QTimer::timeout, this, &InGame::updateTime);
}
void InGame::updateScode(const int score) const
void InGame::updateScode() const
{
this->pts->setText("Points : " + QString::number(score));
this->pts->setText("Points : " + QString::number(this->score));
}
void InGame::updatePos(const std::string& x, const std::string &y) const
@@ -83,3 +83,13 @@ void InGame::updateTime()
void InGame::stopTimer() const {
this->timer->stop();
}
void InGame::addScore(int score) {
this->score += score;
this->updateScode();
}
void InGame::setScore(int score) {
this->score = score;
this->updateScode();
}