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


C++ Turtle::getHelms方法代码示例

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


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

示例1: spawnSeaCreature

void ObjectFactory::spawnSeaCreature(float xPos, float yPos,vector<Station*> *ships)
{
	int seaCreatureSpawnNum = rand() % 7;
	int rotation =  rand() % 360;
	switch (seaCreatureSpawnNum)
	{
	case 0:
	ships->push_back( new Whale(xPos, yPos, rotation));
	break;
	case 1:
	ships->push_back( new Hydra(xPos, yPos, rotation));
	break;
	case 2:
	ships->push_back( new Jellyfish(xPos, yPos, rotation));
	break;
	case 3:
	ships->push_back( new Octopus(xPos, yPos, rotation));
	break;
	case 4:
	ships->push_back( new Squid(xPos, yPos, rotation));
	break;
	case 5:
	ships->push_back( new Serpent(xPos, yPos, rotation));
	break;
	case 6:
	Turtle* myTurtle = new Turtle(xPos ,yPos,rotation);
	Helm* helm = new Helm(0, 10, 32, TextureManager::getManager()->helm,myTurtle);
	myTurtle->getHelms()->push_back(helm);
	ships->push_back(myTurtle);
	break;
	}
}
开发者ID:michael-whelan,项目名称:Skeleton-Crew,代码行数:32,代码来源:ObjectFactory.cpp

示例2: seaCreatureSelect

Station* ObjectFactory::seaCreatureSelect(float xPos, float yPos)
{
	int seaCreatureNum = rand() % 7;
	int rotation =  rand() % 360;
	if (seaCreatureNum == 0)
	{
		return new Whale(xPos, yPos, rotation);
	}
	else if (seaCreatureNum == 1)
	{
		return new Hydra(xPos, yPos, rotation);
	}
	else if (seaCreatureNum == 2)
	{
		return new Jellyfish(xPos, yPos, rotation);
	}
	else if (seaCreatureNum == 3)
	{
		return new Octopus(xPos, yPos, rotation);
	}
	else if (seaCreatureNum == 4)
	{
		return new Squid(xPos, yPos, rotation);
	}
	else if (seaCreatureNum == 5)
	{
		return new Serpent(xPos, yPos, rotation);
	}
	else if (seaCreatureNum == 6)
	{
		Turtle* myTurtle = new Turtle(xPos ,yPos,rotation);
		Helm* helm = new Helm(0, 10, 32, TextureManager::getManager()->helm,myTurtle);
		myTurtle->getHelms()->push_back(helm);
		return myTurtle;
	}
}
开发者ID:michael-whelan,项目名称:Skeleton-Crew,代码行数:36,代码来源:ObjectFactory.cpp


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