|
|
|
@ -1,7 +1,7 @@ |
|
|
|
|
#include <world.h> |
|
|
|
|
#include <screen.h> |
|
|
|
|
#include <stdlib.h> |
|
|
|
|
|
|
|
|
|
#include <string.h> |
|
|
|
|
void drawScore(){ |
|
|
|
|
werase(scoreWin); |
|
|
|
|
box(scoreWin, 0, 0); |
|
|
|
@ -12,18 +12,6 @@ void drawScore(){ |
|
|
|
|
wnoutrefresh(scoreWin); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void drawGameOverWin(){ |
|
|
|
|
getmaxyx(stdscr,scrRows,scrCols); |
|
|
|
|
gameOverWin=newwin(scrRows/2,scrCols/2,scrRows/4,scrCols/4); |
|
|
|
|
nodelay(stdscr, FALSE); |
|
|
|
|
box(gameOverWin,0,0); |
|
|
|
|
wnoutrefresh(gameOverWin); |
|
|
|
|
doupdate(); |
|
|
|
|
getch(); |
|
|
|
|
endwin(); |
|
|
|
|
exit(0); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void drawViewport(){ |
|
|
|
|
box(viewportWin,0,0); |
|
|
|
|
int i; |
|
|
|
@ -43,3 +31,21 @@ void drawViewport(){ |
|
|
|
|
wnoutrefresh(viewportWin); |
|
|
|
|
doupdate(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void drawGameOverWin(){ |
|
|
|
|
getmaxyx(stdscr,scrRows,scrCols); |
|
|
|
|
gameOverWin=newwin(scrRows/2,scrCols/2,scrRows/4,scrCols/4); |
|
|
|
|
box(gameOverWin,0,0); |
|
|
|
|
int gameOverWinRows, gameOverWinCols; |
|
|
|
|
getmaxyx(gameOverWin,gameOverWinRows,gameOverWinCols); |
|
|
|
|
mvwprintw(gameOverWin,1,(gameOverWinCols-strlen("GAME OVER"))/2,"%s","GAME OVER"); |
|
|
|
|
nodelay(stdscr, FALSE); |
|
|
|
|
wnoutrefresh(gameOverWin); |
|
|
|
|
doupdate(); |
|
|
|
|
char input = getch(); |
|
|
|
|
if (input == 'q' || input == 'Q'){ |
|
|
|
|
endwin(); |
|
|
|
|
exit(0); |
|
|
|
|
} |
|
|
|
|
drawGameOverWin(); |
|
|
|
|
} |
|
|
|
|