summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortom <tom@ground-control>2015-11-20 14:48:49 -0600
committertom <tom@ground-control>2015-11-20 14:48:49 -0600
commit5d3145ca44d7966326136adc1bd2dec910b5a8d2 (patch)
tree4ed92da30484557d0ba9d757583e87233320a2cd /src
parent65dacb1ed94502f19c9eb4404f8d016689c57e20 (diff)
fixed trailing cursor
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;