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


C++ Hotspot::setDirection方法代码示例

本文整理汇总了C++中Hotspot::setDirection方法的典型用法代码示例。如果您正苦于以下问题:C++ Hotspot::setDirection方法的具体用法?C++ Hotspot::setDirection怎么用?C++ Hotspot::setDirection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Hotspot的用法示例。


在下文中一共展示了Hotspot::setDirection方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: enemyKilled

void FightsManager::enemyKilled() {
	Resources &res = Resources::getReference();
	Hotspot *playerHotspot = res.getActiveHotspot(PLAYER_ID);
	FighterRecord &playerRec = getDetails(PLAYER_ID);

	playerHotspot->setTickProc(PLAYER_TICK_PROC_ID);
	playerRec.fwhits = GENERAL_MAGIC_ID;
	playerHotspot->resource()->colorOffset = 128;
	playerHotspot->setSize(32, 48);
	playerHotspot->resource()->width = 32;
	playerHotspot->resource()->height = 48;
	playerHotspot->setAnimationIndex(PLAYER_ANIM_INDEX);
	playerHotspot->setPosition(playerHotspot->x(), playerHotspot->y() + 5);
	playerHotspot->setDirection(LEFT);

	if (playerHotspot->roomNumber() == 6) {
		Dialog::show(0xc9f);
		HotspotData *axeHotspot = res.getHotspot(0x2738);
		axeHotspot->roomNumber = PLAYER_ID;
		axeHotspot->flags |= HOTSPOTFLAG_FOUND;

		// Prevent the weapon animation being drawn
		axeHotspot = res.getHotspot(0x440);
		axeHotspot->layer = 0;
	}
}
开发者ID:AReim1982,项目名称:scummvm,代码行数:26,代码来源:fights.cpp

示例2: normalGoewin

void Script::normalGoewin(uint16 v1, uint16 v2, uint16 v3) {
	Resources &res = Resources::getReference();
	Hotspot *hotspot = res.getActiveHotspot(GOEWIN_ID);
	assert(hotspot);

	if (!hotspot->currentActions().isEmpty())
		hotspot->currentActions().top().setAction(DISPATCH_ACTION);
	hotspot->setCharacterMode(CHARMODE_NONE);
	hotspot->setDirection(UP);
	hotspot->setTickProc(STANDARD_CHARACTER_TICK_PROC);

	// Clear walk to position for Goewin so player must walk up to her when interacting
	hotspot->resource()->walkX = 0;
	hotspot->resource()->walkY = 0;
}
开发者ID:Bundesdrucker,项目名称:scummvm,代码行数:15,代码来源:scripts.cpp

示例3: getHotspot

Hotspot *Resources::addHotspot(uint16 hotspotId) {
	HotspotData *hData = getHotspot(hotspotId);
	assert(hData);
	Hotspot *hotspot = new Hotspot(hData);
	_activeHotspots.push_back(HotspotList::value_type(hotspot));

	if (hotspotId < FIRST_NONCHARACTER_ID) {
		// Default characters to facing upwards until they start moving
		hotspot->setDirection(UP);
		hotspot->setCharRectY(0);

		// When reactivating an NPC, ensure that their previous state wasn't PROCESSING_PATH, since
		// the pause has destroyed the previously decided destination position
		if (!hData->npcSchedule.isEmpty() && (hData->npcSchedule.top().action() == PROCESSING_PATH))
			hData->npcSchedule.top().setAction(DISPATCH_ACTION);
	}

	return hotspot;
}
开发者ID:,项目名称:,代码行数:19,代码来源:


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