本文整理汇总了C++中graphicsLib::draw_hp_bar方法的典型用法代码示例。如果您正苦于以下问题:C++ graphicsLib::draw_hp_bar方法的具体用法?C++ graphicsLib::draw_hp_bar怎么用?C++ graphicsLib::draw_hp_bar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类graphicsLib
的用法示例。
在下文中一共展示了graphicsLib::draw_hp_bar方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: redraw_boss_door
/// @TODO: fix animation. investigate a better way for drawing it (code is way too confusing)
void classMap::redraw_boss_door(bool is_close, int nTiles, int tileX, short player_number) {
int k, tileCount;
//is_close = false; // THIS IS A TEMPORARY FIX
//std::cout << "classMap::redraw_boss_door - is_close: " << is_close << std::endl;
input.waitTime(10);
//for (k=0; k<tilePieces; k++) {
for (k=0; k<nTiles; k++) {
tileCount = nTiles;
//if (is_close == false) { std::cout << "classMap::redraw_boss_door - nTiles: " << nTiles << ", tilePieces: " << tilePieces << ", tileCount: " << tileCount << std::endl; }
// redraw screen
showMap();
graphLib.updateScreen();
int tiles_showed;
if (is_close == false) {
tiles_showed = k;
} else {
tiles_showed = 0;
}
for (int i=0; i<MAP_W; i++) {
for (int j=0; j<MAP_H; j++) {
if (map_tiles.tiles[i][j].tile3.x != -1 && map_tiles.tiles[i][j].tile3.y != -1) {
if (i == tileX && map_tiles.tiles[i][j].locked == TERRAIN_DOOR) {
//std::cout << "****** redraw_boss_door - k: " << k << ", tiles_showed: " << tiles_showed << ", nTiles: " << nTiles << std::endl;
if (is_close == false) {
if (tiles_showed < nTiles) {
graphLib.placeTile(st_position(map_tiles.tiles[i][j].tile3.x, map_tiles.tiles[i][j].tile3.y), st_position((i*TILESIZE)-scroll.x, (j*TILESIZE)-scroll.y), &graphLib.gameScreen);
graphLib.updateScreen();
tiles_showed++;
}
} else {
if (tiles_showed < k) {
graphLib.placeTile(st_position(map_tiles.tiles[i][j].tile3.x, map_tiles.tiles[i][j].tile3.y), st_position((i*TILESIZE)-scroll.x, (j*TILESIZE)-scroll.y), &graphLib.gameScreen);
graphLib.updateScreen();
tiles_showed++;
}
}
} else {
graphLib.placeTile(st_position(map_tiles.tiles[i][j].tile3.x, map_tiles.tiles[i][j].tile3.y), st_position((i*TILESIZE)+scroll.x, (j*TILESIZE)-scroll.y), &graphLib.gameScreen);
}
}
}
}
_player_list.at(0)->show();
graphLib.draw_hp_bar(_player_list.at(0)->get_current_hp(), player_number, WEAPON_DEFAULT);
//show_sprite(p1Obj->sprite, game_screen);
//draw_hp_bar(p1Obj);
graphLib.updateScreen();
input.waitTime(100);
}
input.waitTime(100);
}