diff options
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/main.cpp b/src/main.cpp index 93693ee..2a33d65 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -17,19 +17,20 @@ int main() while(true) { char c = getch(); - + Location l = cursor.getLocation(); if (c == 'h') - cursor.move(cursor.getRow(),cursor.getCol()-1); + l.y = l.y-1; else if (c == 'l') - cursor.move(cursor.getRow(),cursor.getCol()+1); + l.y = l.y+1; else if (c == 'k') - cursor.move(cursor.getRow()-1,cursor.getCol()); + l.x = l.x+1; else if (c == 'j') - cursor.move(cursor.getRow()+1,cursor.getCol()); + l.x = l.x-1; else if (c == 'q') - break; + break; - L.actions(); + cursor.move(l); + L.action(); map.fillWindow(); L.draw(map.getWin()); cursor.draw(map.getWin()); |