Hej! Mój problem polega na tym, że mam if'a który sprawdza co jedno kliknięcie enter'em czy dana zmienna jest równa 200. Tylko, że nawet jak to 200 się pojawi to ten kod który ma się wykonać nie wykonuje się ;/
Kod:
unsigned char znak;
int kod;
do
{
znak = getch();
kod = static_cast < int >( znak );
if( kod == 13 )
{
(usunąłem bo się kod nie mieścił)
}
}
if (klikniecia==10) // ten if
{
Sleep(1000);
system("cls");
cout << "" << endl;
cout << " Twoj boss to (nazwa)! " << endl;
SetConsoleTextAttribute( hOut, FOREGROUND_RED | FOREGROUND_INTENSITY );
Sleep(1000);
cout << " Walczymy! F to klucz to wygranej! " << endl;
Sleep (1000);
system("cls");
Sleep (1000);
system("cls");
cout << "" << endl;
cout << "" << endl;
cout << "" << endl;
cout << "" << endl;
cout << " POSTEP:" << endl;
cout << " [-------------------------------------------------------]" << endl;
cout << " [-------------------------------------------------------]" << endl;
cout << " [-------------------------------------------------------]" << endl;
cout << " [-------------------------------------------------------]" << endl;
cout << " [-------------------------------------------------------]" << endl;
int hpbossa = 1350;
if (kod==102)
{
hpbossa = hpbossa - 1;
if (hpbossa==1200)
{
system("cls");
cout << "" << endl;
cout << "" << endl;
cout << "" << endl;
cout << "" << endl;
cout << " POSTEP:" << endl;
cout << " [---------------------------------------------- ]" << endl;
cout << " [---------------------------------------------- ]" << endl;
cout << " [---------------------------------------------- ]" << endl;
cout << " [---------------------------------------------- ]" << endl;
cout << " [---------------------------------------------- ]" << endl;
}
if (hpbossa==1000)
{
system("cls");
cout << "" << endl;
cout << "" << endl;
cout << "" << endl;
cout << "" << endl;
cout << " POSTEP:" << endl;
cout << " [----------------------------------- ]" << endl;
cout << " [----------------------------------- ]" << endl;
cout << " [----------------------------------- ]" << endl;
cout << " [----------------------------------- ]" << endl;
cout << " [----------------------------------- ]" << endl;
}
if (hpbossa==710)
{
system("cls");
cout << "" << endl;
cout << "" << endl;
cout << "" << endl;
cout << "" << endl;
cout << " POSTEP:" << endl;
cout << " [------------------------- ]" << endl;
cout << " [------------------------- ]" << endl;
cout << " [------------------------- ]" << endl;
cout << " [------------------------- ]" << endl;
cout << " [------------------------- ]" << endl;
}
if (hpbossa==415)
{
system("cls");
cout << "" << endl;
cout << "" << endl;
cout << "" << endl;
cout << "" << endl;
cout << " POSTEP:" << endl;
cout << " [------------ ]" << endl;
cout << " [------------ ]" << endl;
cout << " [------------ ]" << endl;
cout << " [------------ ]" << endl;
cout << " [------------ ]" << endl;
}
if (hpbossa==0)
{
system("cls");
cout << "" << endl;
cout << "" << endl;
cout << "" << endl;
cout << "" << endl;
cout << " POSTEP:" << endl;
cout << " [ ]" << endl;
cout << " [ ]" << endl;
cout << " [ ]" << endl;
cout << " [ ]" << endl;
cout << " [ ]" << endl;
Sleep(1000);
cout << "Uruchom ponownie gre :)" << endl;
}
}
}
}
}
while( kod != 27 );
return 0;
Z góry dzięki