Skip to content

Commit

Permalink
dodanie strzalek
Browse files Browse the repository at this point in the history
  • Loading branch information
GummyBear45 committed Sep 26, 2018
1 parent 424776a commit 795419d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,24 @@ char getEvent()
}// pobierz znak
void doEvent(char c) {
c = toupper(c);
unsigned char strzalka =c;
COORDS n=player_coords;
switch(c) {
case 'W': --n.y; break;
case 'S': ++n.y; break;
case 'A': --n.x; break;
case 'D': ++n.x; break;
}
switch( strzalka ){
case 0: //klawisze specjalne (czasem zero czasem 224 - zale¿ne od pc'ta chyba)
case 224: //klawisze specjalne
strzalka = getch();
switch( strzalka ){
case 72: --n.y; break;
case 80: ++n.y; break;
case 75:--n.x; break;
case 77:++n.x; break;
}}
if(!isWall(n))
player_coords = n;

Expand Down

0 comments on commit 795419d

Please sign in to comment.