Skip to content

Instantly share code, notes, and snippets.

@Devhobby
Created April 16, 2018 23:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Devhobby/953af33ee43bbfd14f54db4444f95631 to your computer and use it in GitHub Desktop.
Save Devhobby/953af33ee43bbfd14f54db4444f95631 to your computer and use it in GitHub Desktop.
End Game
int Player::gameOver()
{
system("cls");
std::cout << " HP " << get_playerHp() << " zakonczone rundy " << get_playerRounds() << " Pozostalo czasu "
<< get_playerTime() << std::endl << std::endl;
if (get_endGame() == 1) std::cout << "\nNiestety twoje zdrowie spadlo do zera... umarles :) " << std::endl;
if (get_endGame() == 2) std::cout << "\nUciekasz wyjsciem bezpieczenstwa przed zakonczeniem zadania." << std::endl;
if (get_endGame() == 4) std::cout << "\nNiestety koniec czasu - przegrales." << std::endl;
if (get_endGame() == 3)
{
std::cout << "\n\nGRATULACJE udalo ci sie wygrac !!!!" << std::endl;
if (hardMode) //tabele wynikow wprowadzamy tylko dla wysokiej trudnosci gry (oczywiscie nic nie stoi na przeszkodzie stworzyc osobna tabele dla niskiej trudnosci)
{
ScoreBoard scoreQ;
scoreQ.showScoreBoard(get_playerHp() / 2 + get_playerTime());
}
else
std::cout << "\nuzyskales " << get_playerHp() / 2 + get_playerTime() << " punktow" << std::endl;
}
std::cout << "\nKoniec gry nacisnij Q\nPonowna gra nacisnij E" << std::endl;
int tst;
do
{
char endChoice = _getch();
if (endChoice == 'e' || endChoice == 'E')return 0;
if (endChoice == 'q' || endChoice == 'Q')return 1;
tst = 1;
} while (tst == 1);
return 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment