本文整理汇总了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();
}
示例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 ();
}