Broke some functions into smaller pieces, added the initial keyboard interface.

This commit is contained in:
Murilo Soares Pereira
2010-04-13 01:07:00 -03:00
parent 82d9ee9cb4
commit 67f4775dc4
7 changed files with 73 additions and 31 deletions

View File

@@ -1,10 +1,30 @@
#include <stdlib.h>
#include "../lib/util.h"
#include "../lib/game.h"
#include "../lib/keyboard.h"
int main(int argc, const char *argv[]) {
int option;
initialize_curses();
initialize_game();
greet_player();
while (1) {
switch (option = getch()) {
case KEY_SPACEBAR:
initialize_game();
break;
case 'q':
case 'Q':
end_curses();
exit(0);
}
}
while (1) {
key_event();
}
return(0);
}