Broke some functions into smaller pieces, added the initial keyboard interface.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user