Commit 0e710492 authored by Konrad McClure's avatar Konrad McClure

autosave

parent ea79e367
......@@ -57,11 +57,16 @@ void C2048GameOverState::HandleEvents(CGameEngine* game)
if (!scoreSet)
{
system("stty cooked");
cout << "Press enter to continue" << endl;
game->inputPause = true;
while (game->newInput == false) {}
highscores.userInputNameMakeScore(game->GetScore());
userRank = highscores.userInputNameMakeScore(game->GetScore());
scoreSet = true;
system("stty raw");
game->inputPause = false;
}
......@@ -99,6 +104,17 @@ void C2048GameOverState::Draw(CGameEngine* game)
highscores.displayScores();
if (scoreSet)
{
cout << endl << "Your score:" << endl;
highscores.useRankFindScore(userRank);
}
if (scoreSet)
{
cout << "Press x to return to main menu" << endl;
}
highscores.updateFile("../SaveLoad/2048Data.txt");
system("stty raw");
......
......@@ -29,6 +29,7 @@ class C2048GameOverState : public CGameState
char input;
string menuTitle;
SL2048 highscores;
int userRank = 0;
bool isInit = false;
bool scoreSet = false;
......
......@@ -111,8 +111,11 @@ void CSnakeGameOverState::Draw(CGameEngine* game)
highscores.useRankFindScore(userRank);
}
cout << "Press x to return to main menu" << endl;
if (scoreSet)
{
cout << "Press x to return to main menu" << endl;
}
highscores.updateFile("../SaveLoad/snakedata.txt");
system("stty raw");
......
......@@ -16,6 +16,7 @@ bvn 1268
POP 636
kom 428
vbv 172
dip 128
asd 68
dad 36
kkk 0
......@@ -11,3 +11,6 @@ aaa 10
aaa 5
sss 5
aaa 1
kko 1
dip 0
mko 0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment