aboutsummaryrefslogtreecommitdiffstats
path: root/src/YetiHack.cpp
diff options
context:
space:
mode:
authorRay Hogenson <rayhogenson@gmail.com>2012-03-30 16:05:46 -0800
committerRay Hogenson <rayhogenson@gmail.com>2012-03-30 16:05:46 -0800
commit8cc990202c8344b61f004ba922f4f013b1567ab6 (patch)
tree863f45be59430a6b992d408f1561000a7678e879 /src/YetiHack.cpp
parentadded an exit option (diff)
downloadyetihack-8cc990202c8344b61f004ba922f4f013b1567ab6.tar.zst
added arrow key support
Diffstat (limited to 'src/YetiHack.cpp')
-rw-r--r--src/YetiHack.cpp10
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;
}