Last active
April 8, 2018 21:31
-
-
Save Devhobby/d531e33616d0005c4390950f731c4d7b to your computer and use it in GitHub Desktop.
If- else if wersja 1.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int actualMove; | |
do | |
{ | |
tst = 0; | |
char keyboardChar = _getch(); //Pobieranie znaku z klawiatury | |
if ((keyboardChar == 'w' || keyboardChar == 'W') && p_p_worldArr[p_player->get_actX()][p_player->get_actY()].get_exitCell(0)) actualMove = 0; | |
else if ((keyboardChar == 'd' || keyboardChar == 'D') && p_p_worldArr[p_player->get_actX()][p_player->get_actY()].get_exitCell(1)) actualMove = 1; | |
else if ((keyboardChar == 's' || keyboardChar == 'S') && p_p_worldArr[p_player->get_actX()][p_player->get_actY()].get_exitCell(2)) actualMove = 2; | |
else if ((keyboardChar == 'a' || keyboardChar == 'A') && p_p_worldArr[p_player->get_actX()][p_player->get_actY()].get_exitCell(3)) actualMove = 3; | |
else if ((keyboardChar == 'q' || keyboardChar == 'Q') && (p_player->get_actX() == p_player->get_endX() && p_player->get_actY() == p_player->get_endY())) actualMove = 4; | |
else if (keyboardChar == 'e' || keyboardChar == 'E') actualMove = 5; | |
else if (keyboardChar == 'r' || keyboardChar == 'R') actualMove = 6; | |
else tst = 1; | |
} while (tst == 1); | |
return actualMove; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment