summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/main.cpp b/src/main.cpp
index baba44a..1066d08 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -11,31 +11,28 @@ int main()
Character cursor('X',3,map.getHeight()/2,map.getWidth()/2);
map.fillWindow();
- cursor.draw(map.getWin());
- //view.center(cursor);
L.draw(map.getWin());
- view.refresh();
-
+ cursor.draw(map.getWin());
+
while(true)
{
char c = getch();
if (c == 'h')
- map.add(cursor,cursor.getRow(),cursor.getCol()-1);
+ cursor.move(cursor.getRow(),cursor.getCol()-1);
else if (c == 'l')
- map.add(cursor,cursor.getRow(),cursor.getCol()+1);
+ cursor.move(cursor.getRow(),cursor.getCol()+1);
else if (c == 'k')
- map.add(cursor,cursor.getRow()-1,cursor.getCol());
+ cursor.move(cursor.getRow()-1,cursor.getCol());
else if (c == 'j')
- map.add(cursor,cursor.getRow()+1,cursor.getCol());
+ cursor.move(cursor.getRow()+1,cursor.getCol());
else if (c == 'q')
- break;
+ break;
- view.center(cursor);
- view.refresh();
map.fillWindow();
- cursor.draw(map.getWin());
L.draw(map.getWin());
+ cursor.draw(map.getWin());
+ view.center(cursor);
}
return 0;