本文整理汇总了C++中Boss::getheight方法的典型用法代码示例。如果您正苦于以下问题:C++ Boss::getheight方法的具体用法?C++ Boss::getheight怎么用?C++ Boss::getheight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Boss
的用法示例。
在下文中一共展示了Boss::getheight方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: create_enemy
void Logic::create_enemy(float t){//生产敌机的逻辑
t*=50;
int flag=(int)t;
if(flag%100==0 && flag<=1500){
EnemyPlane1* temp = new EnemyPlane1(*enemy_type[0]);
EnemyPlane1* temp1 = new EnemyPlane1(*enemy_type[0]);
temp->set_pos(Position(-temp->getwidth()/2,-temp->getheight()/2));
temp1->set_pos(Position(win_width+temp1->getwidth()/2,-temp->getheight()/2));
enemy.push_back(temp);
enemy.push_back(temp1);
}
if(flag%400==0 && flag>400 && flag<=3200){
EnemyPlane2* temp = new EnemyPlane2(*enemy_type[1]);
EnemyPlane2* temp1 = new EnemyPlane2(*enemy_type[1]);
EnemyPlane2* temp2 = new EnemyPlane2(*enemy_type[1]);
temp->set_pos(Position(win_width/2,-temp->getheight()/2));
temp1->set_pos(Position(win_width/4,-temp->getheight()/2));
temp2->set_pos(Position(win_width*3/4,-temp->getheight()/2));
enemy.push_back(temp);
enemy.push_back(temp1);
enemy.push_back(temp2);
}
if(flag%100==0&&flag>1000 && flag<=3600){
EnemyPlane3* temp1 = new EnemyPlane3(*enemy_type[2]);
EnemyPlane3* temp2 = new EnemyPlane3(*enemy_type[2]);
int range = int(win_width - temp1->getwidth());
float start = temp1->getwidth()/2;
temp1->set_pos(Position(start+rand()%range,-temp1->getheight()/2));
temp2->set_pos(Position(start+rand()%range,-temp2->getheight()/2));
enemy.push_back(temp1);
enemy.push_back(temp2);
}
if(flag == 3600){
Boss* temp = new Boss(*enemy_type[3]);
temp->set_pos(Position(win_width/2,-temp->getheight()/2));
enemy.push_back(temp);
}
}