changement humeur carrote avec scoremultiplier
This commit is contained in:
parent
f30a490593
commit
c8787846c3
2 changed files with 10 additions and 0 deletions
|
@ -22,6 +22,8 @@ public:
|
|||
void setPosition(sf::Vector2f);
|
||||
void setScale(sf::Vector2f);
|
||||
void changeState(CarrotState new_state);
|
||||
|
||||
CarrotState getState() const { return carrotState; };
|
||||
};
|
||||
|
||||
static std::vector<std::string> ANGRY_PATHS = {
|
||||
|
|
|
@ -157,4 +157,12 @@ void Game::update_scores(bool good_action) {
|
|||
ScoreText.setString(std::format("Score = {}", score));
|
||||
ScoreMultiplierText.setString(
|
||||
std::format("ScoreMultiplier = {}", score_multiplier));
|
||||
|
||||
if (score_multiplier < 5) {
|
||||
carrot.changeState(Angry);
|
||||
} else if (score_multiplier < 10) {
|
||||
carrot.changeState(Neutral);
|
||||
} else {
|
||||
carrot.changeState(Happy);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue