diff --git a/SimpleGame/src/Include/Carrot.hpp b/SimpleGame/src/Include/Carrot.hpp index 04aec96..5486351 100644 --- a/SimpleGame/src/Include/Carrot.hpp +++ b/SimpleGame/src/Include/Carrot.hpp @@ -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 ANGRY_PATHS = { diff --git a/SimpleGame/src/Source/Game.cpp b/SimpleGame/src/Source/Game.cpp index 26ddce7..41de2d4 100644 --- a/SimpleGame/src/Source/Game.cpp +++ b/SimpleGame/src/Source/Game.cpp @@ -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); + } }