しかし瞬間的にループ回数が増えるためか処理落ちしてしまいます.
どのような改善策がありますか?ソースは以下に貼っていきます
define.hの以下を変更
//アイテムの表示最大数
#define ITEM_MAX 200
out.cppに以下を追加
//ボス弾の位置に点数アイテムを置く void enter_boss_item(){ int i,item_n[1]={6}; for(i=0;i<BOSS_BULLET_MAX;i++){ enter_item(boss_shot.bullet.x, boss_shot.bullet.y, item_n, 1); } }
boss_shot.cppでextern void enter_boss_item();を宣言して,
boss_shot_main()の赤字部分を追加
//ボスの弾幕メイン
void boss_shot_main(){
if(stage_count==boss.appear_count[0] && boss.flag==0)//開始時間なら
enter_boss(0);//開始
if(boss.flag==0)//ボスが登録されて無ければ戻る
return;
calc_boss();
if(boss.phy.flag==1)//物理演算移動オンなら
calc_phy();//物理計算を
if(boss.state==2 && (boss.hp<=0 || boss.endtime<=0)){//弾幕中で体力が無くなったら
enter_boss_item(),enter_boss(1),se_flag[14]=1;//次の弾幕を登録
}
if(boss.state==1){//弾幕間の待機時間
waitandenter();
}
if(boss.state==2){//弾幕中なら
boss_shot_bullet[boss.knd]();//弾幕関数へ
boss_shot_calc();//弾幕計算
}
boss.cnt++;
}
calc.cppに以下を追加
if(boss.flag==1 && boss.hp<=0){//ボス弾幕終了,点数itemのスピード0でそのまま吸収 item.state=1; item.v=0; calc_item_indraw(i); }