Skip to content

Commit

Permalink
Fixed the bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Yashmerino committed Mar 13, 2021
1 parent 3d57c95 commit f682493
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions headers/Game.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class Game
sf::Font font;
sf::Text turnsText;
sf::String turnsString;
int temp;

private:
sf::Sound audio;
Expand Down
5 changes: 4 additions & 1 deletion src/Game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ Game::Game()
sounds[1].loadFromFile("audio/new.wav");
sounds[2].loadFromFile("audio/correctPair.wav");
sounds[3].loadFromFile("audio/incorrectPair.wav");

temp = 0;
}

Game::~Game()
Expand Down Expand Up @@ -119,6 +121,8 @@ void Game::restartGame()

turnsString = "Turns: 0";
turnsText.setString(turnsString);

temp = 0;
}

void Game::shuffleCards()
Expand Down Expand Up @@ -157,7 +161,6 @@ void Game::shuffleCards()

bool Game::isCorrect()
{
static int temp = 0;
temp += 1;

turnsString = "Turns: " + std::to_string(temp);
Expand Down

0 comments on commit f682493

Please sign in to comment.