From 8cc990202c8344b61f004ba922f4f013b1567ab6 Mon Sep 17 00:00:00 2001 From: Ray Hogenson Date: Fri, 30 Mar 2012 16:05:46 -0800 Subject: added arrow key support --- src/YetiHack.cpp | 10 +++++----- 1 file 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; } -- cgit v1.3.1