Created
December 6, 2018 16:55
-
-
Save Devhobby/68008829cf3c9add0dae9dbed9494e90 to your computer and use it in GitHub Desktop.
wsad
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
do | |
{ | |
tst = 0; | |
char keyboardChar = _getch(); | |
actualMove = (keyboardChar == 'w' || keyboardChar == 'W') && p_p_worldArr[p_player->get_actX()][p_player->get_actY()].get_exitCell(0) ? 0 | |
: (keyboardChar == 'd' || keyboardChar == 'D') && p_p_worldArr[p_player->get_actX()][p_player->get_actY()].get_exitCell(1) ? 1 | |
: (keyboardChar == 's' || keyboardChar == 'S') && p_p_worldArr[p_player->get_actX()][p_player->get_actY()].get_exitCell(2) ? 2 | |
: (keyboardChar == 'a' || keyboardChar == 'A') && p_p_worldArr[p_player->get_actX()][p_player->get_actY()].get_exitCell(3) ? 3 | |
: (keyboardChar == 'q' || keyboardChar == 'Q') && (p_player->get_actX() == p_player->get_endX() && p_player->get_actY() == p_player->get_endY()) ? 4 | |
: keyboardChar == 'e' || keyboardChar == 'E' ? 5 | |
: keyboardChar == 'r' || keyboardChar == 'R' ? 6 | |
: 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