void printHangman(WINDOW *whereToPrint, int yPos, int xPos, char hangman[]) { int i; int j; wmove(whereToPrint, yPos, xPos); for(i = 0; hangman[i] != '\0'; i++) { if (hangman[i] != '\n' && hangman[i] != '/' && hangman[i] != '0') { waddch(whereToPrint, NCURSES_ACS(hangman[i])); } else if (hangman[i] != '\0') { waddch(whereToPrint, hangman[i]); } if (hangman[i] == '\n') { for(j = 0; j < xPos; j++) { waddch(whereToPrint, ' '); } } } wrefresh(whereToPrint); }
static void print_glyphs() { int i = 0; char num[50]; int h = 0; int w = 0; for(i = 0; i < 127; i++) { w++; if(i % 10 == 0) { h++; w = 0; move(h, w); } addch(NCURSES_ACS(i)); sprintf(num, " %d", i); addstr(num); } refresh(); sleep(50); }
void TerminalView::render() { clear(); this->update(); int i; for (i = 0; i < projectilePos->size(); i++) { mvaddch(this->projectilePos->at(i)->getX(), this->projectilePos->at(i)->getY(), this->bullet_char); } // printw("(%d,%d)\n", this->player_pos->getX(), this->player_pos->getY()); for(i = 0; i < enemy_pos->size(); i++) { mvaddch(this->enemy_pos->at(i)->getX(),this->enemy_pos->at(i)->getY(),this->enemy_char); } mvaddch(this->player_pos->getX(), this->player_pos->getY(), this->figher_char); mvprintw(this->vm->get_col_size(),this->vm->get_row_size()/2,"%d\n",this->vm->getScore()); int curHp = this->vm->getHP(); for(i = 0; i < curHp; i++) { mvaddch(this->vm->get_col_size(), i, NCURSES_ACS(ACS_CKBOARD)); } }
void AddACS(int ch, int count) { AddChar(NCURSES_ACS(ch), count); }
void Tile_draw(Tile tile, int x, int y) { move(y, x); attrset(COLOR_PAIR(tile.color)); addch(NCURSES_ACS(tile.glyph)); }