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


C++ Helicopter::getTempoDeVoo方法代码示例

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


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

示例1: timerGasBar

void timerGasBar(int value){
	// on posto
	if(player.getFlying() && !onPosto(player, arena.getPostoAbastecimento())){
		player.decGas();
	}

	// refuels
	if(onPosto(player, arena.getPostoAbastecimento())){
		player.setGas(player.getTempoDeVoo());
	}

	glutTimerFunc((1000),timerGasBar,0);
	glutPostRedisplay();
}
开发者ID:ruanmartinelli,项目名称:cg-tc2,代码行数:14,代码来源:main.cpp

示例2: main

int main(int argc, char* argv[]){
	char path[255];
	if(argc != 2){
		cout << "Running at default path './config/config.xml'..." << endl;
		strcpy(path, "../config/config.xml");
	}else{
		strcpy(path, argv[1]);
		strcat(path, "config.xml");
	}
	srand(time(NULL));

	config.readXML(path);
	arena.readXMLArena((config.getArena().getPath() + config.getArena().getName() + "." + config.getArena().getExtension()).c_str());
	player = config.readHelicopterConfig(path);
	player.setArena(ARENAX, ARENAY);
	enemies.push_back(config.readEnemyHelicopter(path, ARENAX/100 * 90, ARENAY/100 * 10));
	enemies.push_back(config.readEnemyHelicopter(path, ARENAX/100 * 90, ARENAY/100 * 90));
	enemies.push_back(config.readEnemyHelicopter(path, ARENAX/100 * 10, ARENAY/100 * 90));
	enemies.at(0).setAngle(0);

	glutInit 				(&argc, argv);
	glutInitDisplayMode 	(GLUT_DOUBLE | GLUT_RGB);
	glutInitWindowSize 		(ARENAX,ARENAY);
	glutInitWindowPosition 	(0, 0);
	glutCreateWindow 	("Arena");
	init 				(ARENAX, ARENAY);
	glutDisplayFunc		(display);
	glutMouseFunc		(mouse);
	glutIdleFunc		(idle);
	glutKeyboardFunc 	(setKeyDown);
	glutKeyboardUpFunc 	(setKeyUp);

	//timers
	glutTimerFunc((player.getTempoDeVoo() * 1000)/5, timerGasBar, 0);
	glutTimerFunc(rand() % (int)(5 - 2 + 1),timerEnemyMovement,0);
	glutTimerFunc(200,timerEnemyShooting,200);

	glutPassiveMotionFunc(motion);
	glutMainLoop		();

}
开发者ID:ruanmartinelli,项目名称:cg-tc2,代码行数:41,代码来源:main.cpp


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