当前位置: 首页>>代码示例>>C++>>正文


C++ graphicsLib::draw_hp_bar方法代码示例

本文整理汇总了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);
}
开发者ID:DavidKnight247,项目名称:Rockbot-GCW0-port,代码行数:54,代码来源:classmap.cpp


注:本文中的graphicsLib::draw_hp_bar方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。