You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.2 KiB
40 lines
1.2 KiB
#include <world.h>
|
|
#include <screen.h>
|
|
#include <stdlib.h>
|
|
|
|
void drawScore(){
|
|
werase(scoreWin);
|
|
box(scoreWin, 0, 0);
|
|
mvwprintw(scoreWin, 1, 1, "Current Weapon: %s",allEntities[0].weapons[allEntities[0].curWeapon].name);
|
|
mvwprintw(scoreWin, 2, 1, "Ammo: %d/%d",allEntities[0].weapons[allEntities[0].curWeapon].curCapacity,allEntities[0].weapons[allEntities[0].curWeapon].maxCapacity);
|
|
mvwprintw(scoreWin,3,1,"Zombies Killed: %d",allEntities[0].killCount);
|
|
mvwprintw(scoreWin,4,1,"Projectiles Fired: %d",allEntities[0].projectilesFired);
|
|
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;
|
|
for(i=0; i<MAX_ALIVE; i++){
|
|
if(allEntities[i].isAlive){
|
|
mvwaddch(viewportWin, allEntities[i].curYpos, allEntities[i].curXpos, ' ');
|
|
mvwaddch(viewportWin, allEntities[i].nextYpos, allEntities[i].nextXpos, allEntities[i].symbol);
|
|
allEntities[i].curYpos = allEntities[i].nextYpos;
|
|
allEntities[i].curXpos = allEntities[i].nextXpos;
|
|
}
|
|
}
|
|
wnoutrefresh(viewportWin);
|
|
doupdate();
|
|
}
|
|
|