diff options
| author | Ray Hogenson <rayhogenson@gmail.com> | 2012-03-30 16:05:46 -0800 |
|---|---|---|
| committer | Ray Hogenson <rayhogenson@gmail.com> | 2012-03-30 16:05:46 -0800 |
| commit | 8cc990202c8344b61f004ba922f4f013b1567ab6 (patch) | |
| tree | 863f45be59430a6b992d408f1561000a7678e879 | |
| parent | f18c42e8a3591699778cdc70367a1b3f5417c22a (diff) | |
| download | yetihack-8cc990202c8344b61f004ba922f4f013b1567ab6.tar.zst | |
added arrow key support
| -rw-r--r-- | src/YetiHack.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/YetiHack.cpp b/src/YetiHack.cpp index 17d6371..c7c0473 100644 --- a/src/YetiHack.cpp +++ b/src/YetiHack.cpp @@ -65,7 +65,7 @@ int start(bool immortal, bool story, double escapeturns) getmaxyx(stdscr,y,x); sizey = y - 3; sizex = x; - char input; + int input; int yetinum = 1; x = 1; y = 1; @@ -101,7 +101,7 @@ int start(bool immortal, bool story, double escapeturns) move(yetis[i].ypos() - 1, yetis[i].xpos() - 1); addch('.'); } - if (input == '4') + if (input == '4' || input == KEY_LEFT) { --x; } @@ -110,7 +110,7 @@ int start(bool immortal, bool story, double escapeturns) --x; --y; } - else if (input == '8') + else if (input == '8' || input == KEY_UP) { --y; } @@ -119,7 +119,7 @@ int start(bool immortal, bool story, double escapeturns) ++x; --y; } - else if (input == '6') + else if (input == '6' || input == KEY_RIGHT) { ++x; } @@ -128,7 +128,7 @@ int start(bool immortal, bool story, double escapeturns) ++x; ++y; } - else if (input == '2') + else if (input == '2' || input == KEY_DOWN) { ++y; } |
