diff options
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -145,13 +145,17 @@ int main(int argc, char **argv) { while (1) { draw_map(map, width, height, start_pos, end_pos, NULL, path, visited, NULL); - char c = getch(); + int c = getch(); /* TODO: add a keybinding to calculate the path again, or maybe do it on 'a' */ + /* TODO: maybe a kbng to move to start/end? */ + /* TODO: big HJKL to move fasta */ switch (c) { case 'h': map_offset_x += 2; break; case 'l': map_offset_x -= 2; break; case 'j': map_offset_y -= 1; break; case 'k': map_offset_y += 1; break; + case 'z': clear(); map_offset_x = 2; map_offset_y = 1; break; /* Move to top left corner */ + case 'x': clear(); map_offset_x = - width * 2 + COLS - 2; map_offset_y = - height + LINES - 2; break; /* Move to bottom right corner */ case 'a': anim = !anim; break; case 'y': case 'o': @@ -211,6 +215,7 @@ int main(int argc, char **argv) { visited = visited_new(width, height); path = path_func(dirs, map, width, height, start_pos, end_pos, visited, anim); break; + case KEY_RESIZE: clear(); break; case 'q': map_free(map, height); path_free(path, height); endwin(); return 0; } } |
