Since that's nowhere near a complete and minimal code example, it's impossible to say anything for sure, but here's my guess:
When the collision is true I'm setting a bool to not increse the score any more
You seem to be implying that setting the bool to false will somehow keep collisionCoin() from changing it back to true until "this" collision is "done". That's not how bools work.
If this comes as a surprise to you,
you may wish to read a good C++ book.
Assuming that is the problem, something like this would work better:
bool gameHandler::isCollidingWith(Obstacle &o) {
return player.getSprite().getGlobalBounds().intersects(o.getSprite().getGlobalBounds());
}
bool gameHandler::collisionCoin(Obstacle &o) {
if(this->isCollidingWith(o)) {
this->show = false;
if(!this->collisionInProgress) {
// notice we'll only end up in here once per collision
this->score.addScore();
}
this->collisionInProgress = true;
return true;
} else {
this->collisionInProgress = false;
return false;
}
}
From a general software architecture point of view, it's also better to keep your score update logic together with the rest of your update logic. showHighScore() is essentially a getter, so it shouldn't be taking care of updating the value as it gets it.