Add info to Game Over window

main
Jerry Aldrich 11 years ago
parent 126b279afd
commit c24637f519
  1. 15
      drawWindows.c
  2. 1
      world.h

@ -2,6 +2,7 @@
#include <screen.h> #include <screen.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
void drawScore(){ void drawScore(){
werase(scoreWin); werase(scoreWin);
box(scoreWin, 0, 0); box(scoreWin, 0, 0);
@ -39,13 +40,17 @@ void drawGameOverWin(){
int gameOverWinRows, gameOverWinCols; int gameOverWinRows, gameOverWinCols;
getmaxyx(gameOverWin,gameOverWinRows,gameOverWinCols); getmaxyx(gameOverWin,gameOverWinRows,gameOverWinCols);
mvwprintw(gameOverWin,1,(gameOverWinCols-strlen("GAME OVER"))/2,"%s","GAME OVER"); mvwprintw(gameOverWin,1,(gameOverWinCols-strlen("GAME OVER"))/2,"%s","GAME OVER");
mvwprintw(gameOverWin,(gameOverWinRows/2)-1,1,"Shots Fired: %i",allEntities[0].projectilesFired);
mvwprintw(gameOverWin,(gameOverWinRows/2),1,"Zombies Killed: %i",allEntities[0].killCount);
mvwprintw(gameOverWin,(gameOverWinRows)-2,(gameOverWinCols-strlen("Press 'q' to quit"))/2,"%s","Press 'q' to quit");
nodelay(stdscr, FALSE); nodelay(stdscr, FALSE);
wnoutrefresh(gameOverWin); wnoutrefresh(gameOverWin);
doupdate(); doupdate();
char input = getch(); while(true){
if (input == 'q' || input == 'Q'){ char input = getch();
endwin(); if (input == 'q' || input == 'Q'){
exit(0); endwin();
exit(0);
}
} }
drawGameOverWin();
} }

@ -5,6 +5,7 @@
#define MAX_ITEMS 100 #define MAX_ITEMS 100
#include <structs.h> #include <structs.h>
#include <screen.h> #include <screen.h>
#include <time.h>
struct Entity allEntities[MAX_ENTITIES]; struct Entity allEntities[MAX_ENTITIES];

Loading…
Cancel
Save