ページ 11

龍神録プログラミングの館 36章

Posted: 2011年5月29日(日) 14:39
by qhqh
龍神録プログラミングの館 36章でのことです。
boss_shoth.cpp(796): error C2059: 構文エラー : ';'
boss_shoth.cpp(796): error C2143: 構文エラー : ';' が ')' の前にありません。
boss_shoth.cpp(796): error C2143: 構文エラー : ';' が ')' の前にありません。
boss_shoth.cpp(796): error C2143: 構文エラー : ';' が '{' の前にありません。
と言うエラーが出たのですが、プロジェクトに入っているサンプルと比べても変わっている所がなく自分で見ても何処に;を入れればいいのか分かりません。
どなたか何処か分かる方いらっしゃいませんでしょうか?
boss_shoth.cppのエラーまでのコピーです。 Visual C++ 2010を使っています。

コード:

#include "../include/GV.h"

extern int move_boss_pos(double x1,double y1,double x2,double y2,double dist, int t);
extern int search_boss_shot();
extern double bossatan2();
extern double bossatan3(int k,double x,double y);//指定座標と弾との成す角
extern void input_phy_pos(double x,double y,int t);
extern int search_lazer();
extern void input_lphy(lazer_t *laz, int time, double angle);
extern int search_child();

void boss_shot_bulletH000(){
#define TM000 120
        int i,k,t=boss_shot.cnt%TM000,t2=boss_shot.cnt;
        double angle;
        if(t<60 && t%10==0){
                angle=bossatan2();
                for(i=0;i<30;i++){
                        if((k=search_boss_shot())!=-1){
                                boss_shot.bullet[k].col   = 0;
                                boss_shot.bullet[k].x     = boss.x;
                                boss_shot.bullet[k].y     = boss.y;
                                boss_shot.bullet[k].knd   = 8;
                                boss_shot.bullet[k].angle = angle+PI2/30*i;
                                boss_shot.bullet[k].flag  = 1;
                                boss_shot.bullet[k].cnt   = 0;
                                boss_shot.bullet[k].spd   = 3;
                                se_flag[0]=1;
                        }
                }
        }
        for(i=0;i<BOSS_BULLET_MAX;i++){
                if(boss_shot.bullet[i].flag>0){

                }
        }
}

//サイレントセレナ
void boss_shot_bulletH001(){
#define TM001 60
    int i,k,t=boss_shot.cnt%TM001,t2=boss_shot.cnt;
    static int cnum;
    double angle;
    if(t2==0)//最初の初期化
        cnum=0;
    if(t==0){//1ターンの最初の初期化
        boss_shot.base_angle[0]=bossatan2();//自機とボスの角度
        if(cnum%4==3){//4ターンに1回移動
            move_boss_pos(40,30,FMX-40,120,60, 60);
        }
    }
        //1ターンの最初は自機狙い、半分からは自機狙いからずらす
    if(t==TM001/2-1)
        boss_shot.base_angle[0]+=PI2/20/2;
        //1ターンに10回円形発射の弾をうつ
    if(t%(TM001/10)==0){
        angle=bossatan2();//自機-ボスの成す角
        for(i=0;i<20;i++){//20個
            if((k=search_boss_shot())!=-1){
                boss_shot.bullet[k].col   = 4;
                boss_shot.bullet[k].x     = boss.x;
                boss_shot.bullet[k].y     = boss.y;
                boss_shot.bullet[k].knd   = 8;
                                //ベース角度から20個回転して発射
                boss_shot.bullet[k].angle = boss_shot.base_angle[0]+PI2/20*i;
                boss_shot.bullet[k].flag  = 1;
                boss_shot.bullet[k].cnt   = 0;
                boss_shot.bullet[k].spd   = 2.7;//スピード
                se_flag[0]=1;
            }
        }
    }
        //4カウントに1回下に落ちる弾を登録
    if(t%4==0){
        if((k=search_boss_shot())!=-1){
            boss_shot.bullet[k].col   = 0;
            boss_shot.bullet[k].x     = GetRand(FMX);
            boss_shot.bullet[k].y     = GetRand(200);
            boss_shot.bullet[k].knd   = 8;
            boss_shot.bullet[k].angle = PI/2;//真下の角度
            boss_shot.bullet[k].flag  = 1;
            boss_shot.bullet[k].cnt   = 0;
            boss_shot.bullet[k].spd   = 1+rang(0.5);
            se_flag[0]=1;
        }
    }
    if(t==TM001-1)
        cnum++;
}

//パーフェクトフリーズ
void boss_shot_bulletH002(){
#define TM002 650
    int i,k,t=boss_shot.cnt%TM002;
    double angle;
    if(t==0 || t==210){
        //40<x<FMX-40  50<y<150 の範囲で100離れた位置に80カウントで移動する
        move_boss_pos(40,50,FMX-40,150,100, 80);
    }
    //最初のランダム発射
    if(t<180){
        for(i=0;i<2;i++){//1カウントに2回発射
            if((k=search_boss_shot())!=-1){
                boss_shot.bullet[k].col   = GetRand(6);//7種類の色をランダムに
                boss_shot.bullet[k].x     = boss.x;//発射初期座標はボスの位置
                boss_shot.bullet[k].y     = boss.y;
                boss_shot.bullet[k].knd   = 7;//弾の種類
                boss_shot.bullet[k].angle = rang(PI2/20)+PI2/10*t;
                boss_shot.bullet[k].flag  = 1;
                boss_shot.bullet[k].cnt   = 0;
                boss_shot.bullet[k].spd   = 3.2+rang(2.1);
                boss_shot.bullet[k].state = 0;//弾のステータス
                boss_shot.bullet[k].kaiten= 1;//弾を回転するかどうかのフラグ
            }
        }
        if(t%10==0)
            se_flag[0]=1;
    }
    //自機依存による8方向発射
    if(210<t && t<270 && t%3==0){
        angle=bossatan2();
        for(i=0;i<8;i++){
            if((k=search_boss_shot())!=-1){
                boss_shot.bullet[k].col   = 0;
                boss_shot.bullet[k].x     = boss.x;
                boss_shot.bullet[k].y     = boss.y;
                boss_shot.bullet[k].knd   = 7;
                //自機とボスとの成す角を基準に8方向に発射する
                boss_shot.bullet[k].angle = angle-PI/2*0.8+PI*0.8/7*i+rang(PI/180);
                boss_shot.bullet[k].flag  = 1;
                boss_shot.bullet[k].cnt   = 0;
                boss_shot.bullet[k].spd   = 3.0+rang(0.3);
                boss_shot.bullet[k].state = 2;
                boss_shot.bullet[k].kaiten= 1;
            }
        }
        if(t%10==0)
            se_flag[0]=1;
    }
    for(i=0;i<BOSS_BULLET_MAX;i++){
        if(boss_shot.bullet[i].flag>0){
            //tが190の時に全てストップさせ、白くし、カウントリセット
            if(boss_shot.bullet[i].state==0){
                if(t==190){
                    boss_shot.bullet[i].kaiten=0;//弾の回転を止める
                    boss_shot.bullet[i].spd   =0;
                    boss_shot.bullet[i].col   =9;
                    boss_shot.bullet[i].cnt   =0;
                    boss_shot.bullet[i].state =1;//ステータスを1に
                }
            }
            //ランダムな方向に移動し始める
            if(boss_shot.bullet[i].state==1){
                if(boss_shot.bullet[i].cnt==200){
                    boss_shot.bullet[i].angle=rang(PI);//全方向ランダム
                    boss_shot.bullet[i].kaiten=1;//回転するフラグを立てる
                }
                if(boss_shot.bullet[i].cnt>200)
                    boss_shot.bullet[i].spd+=0.01;//段々加速
            }
        }
    }
}

void boss_shot_bulletH003(){
#define TM003 600
#define DF003 20 
    int i,j,k,t=boss_shot.cnt%TM003,t2=boss_shot.cnt;
    static int tcnt,cnt,cnum;
    double angle;
    if(t2==0){
        //40<x<FMX-40  50<y<150 の範囲で100離れた位置に80カウントで移動する
        input_phy_pos(FMX/2,FMY/2, 50);
        cnum=0;
    }
    if(t==0){
        boss_shot.base_angle[0]=bossatan2();
        cnt=0;
        tcnt=2;
    }
    if(t<540 && t%3){
        angle=bossatan2();
        if(tcnt-2==cnt || tcnt-1==cnt){
            if(tcnt-1==cnt){
                boss_shot.base_angle[1]=boss_shot.base_angle[0]+PI2/DF003*cnt*(cnum?-1:1)-PI2/(DF003*6)*3;
                tcnt+=DF003-2;
            }
        }
        else{
            for(i=0;i<6;i++){
                if((k=search_boss_shot())!=-1){
                    boss_shot.bullet[k].col   = cnum?1:4;
                    boss_shot.bullet[k].x     = boss.x;
                    boss_shot.bullet[k].y     = boss.y;
                    boss_shot.bullet[k].knd   = 8;
                    boss_shot.bullet[k].angle 
                     = boss_shot.base_angle[0]+PI2/DF003*cnt*(cnum?-1:1)+PI2/(DF003*6)*i*(cnum?-1:1);
                    boss_shot.bullet[k].flag  = 1;
                    boss_shot.bullet[k].cnt   = 0;
                    boss_shot.bullet[k].spd   = 2;
                    se_flag[0]=1;
                }
            }
        }
        cnt++;
    }
    if(40<t&&t<540 && t%30==0){
        for(j=0;j<3;j++){
            angle=boss_shot.base_angle[1]-PI2/36*4;
            for(i=0;i<27;i++){
                if((k=search_boss_shot())!=-1){
                    boss_shot.bullet[k].col      = cnum?6:0;
                    boss_shot.bullet[k].x     = boss.x;
                    boss_shot.bullet[k].y     = boss.y;
                    boss_shot.bullet[k].knd   = 7;
                    boss_shot.bullet[k].angle = angle;
                    boss_shot.bullet[k].flag  = 1;
                    boss_shot.bullet[k].cnt      = 0;
                    boss_shot.bullet[k].spd      = 4-1.6/3*j;
                    se_flag[0]=1;
                }
                angle-=PI2/36;
            }
        }
    }
//    for(i=0;i<BOSS_BULLET_MAX;i++){
//        if(boss_shot.bullet[i].flag>0){
//
//        }
//    }
    if(t==TM003-1)
        cnum++;
}

void boss_shot_bulletH004(){
#define TM004 200
    int i,k,n,t=boss_shot.cnt%TM004,t2=boss_shot.cnt;
    static int tm;
    double angle;
    //周期の最初にtmをセット
    if(t==0)
        tm=(int)(190+rang(30));
    angle=PI*1.5+PI/6*sin(PI2/tm*t2);
    //4カウントに1回上に8way弾を撃つ
    if(t2%4==0){
        for(n=0;n<8;n++){
            if((k=search_boss_shot())!=-1){
                boss_shot.bullet[k].flag=1;
                boss_shot.bullet[k].state=0;
                boss_shot.bullet[k].cnt=0;
                boss_shot.bullet[k].knd=4;
                boss_shot.bullet[k].col=0;
                boss_shot.bullet[k].angle=0;
                boss_shot.bullet[k].eff_detail=1;
                boss_shot.bullet[k].x=boss.x;
                boss_shot.bullet[k].y=boss.y;
                boss_shot.bullet[k].vx = cos(angle-PI/8*4+PI/8*n+PI/16)*3;
                boss_shot.bullet[k].vy = sin(angle-PI/8*4+PI/8*n+PI/16)*3;
            }
        }
        se_flag[0]=1;
    }
    if(t%1==0 && t2>80){
        int num=1;
        if(t%2)
            num=2;
        for(n=0;n<num;n++){
            if((k=search_boss_shot())!=-1){
                angle=PI*1.5-PI/2+PI/12*(t2%13)+rang(PI/15);
                boss_shot.bullet[k].flag=1;
                boss_shot.bullet[k].state=1;
                boss_shot.bullet[k].cnt=0;
                boss_shot.bullet[k].knd=8;
                boss_shot.bullet[k].eff_detail=0;
                boss_shot.bullet[k].col=4;
                boss_shot.bullet[k].angle=0;
                boss_shot.bullet[k].x=boss.x;
                boss_shot.bullet[k].y=boss.y;
                boss_shot.bullet[k].vx = cos(angle)*1.4*1.2;
                boss_shot.bullet[k].vy = sin(angle)*1.4;
            }
        }
        se_flag[7]=1;
    }
    for(i=0;i<BOSS_BULLET_MAX;i++){
        if(boss_shot.bullet[i].flag>0){
            if(boss_shot.bullet[i].state==0){
                if(boss_shot.bullet[i].cnt<150)
                    boss_shot.bullet[i].vy+=0.03;
                boss_shot.bullet[i].x+=boss_shot.bullet[i].vx;
                boss_shot.bullet[i].y+=boss_shot.bullet[i].vy;
            }
            if(boss_shot.bullet[i].state==1){
                if(boss_shot.bullet[i].cnt<160)
                    boss_shot.bullet[i].vy+=0.03;
                boss_shot.bullet[i].x+=boss_shot.bullet[i].vx;
                boss_shot.bullet[i].y+=boss_shot.bullet[i].vy;
                boss_shot.bullet[i].angle=atan2(boss_shot.bullet[i].vy,boss_shot.bullet[i].vx);
            }
        }
    }
}

//☆弾
void boss_shot_bulletH005(){
#define TM005 820
#define RANGE005 100.0
#define LEM005 4
    int i,j,k,t=boss_shot.cnt%TM005,t2=boss_shot.cnt;
    static int sst,bnum;
    static double sx,sy,sangle;
        //1周期の最初なら
    if(t==0){
        sst=0;
        sx=boss.x;
        sy=boss.y-RANGE005;
        sangle=PI/5/2+PI/2;
        bnum=0;
    }
        //星を描く
    if(sst<=4){
        for(i=0;i<2;i++){
            sx+=cos(sangle)*LEM005;//座標を計算
            sy+=sin(sangle)*LEM005;
                        //円と交わったら
            if((sx-boss.x)*(sx-boss.x)+(sy-boss.y)*(sy-boss.y)>RANGE005*RANGE005){
                sangle-=(PI-PI/5);//方向転換
                sst++;//ステータス変換
                if(sst==5)break;//5なら終わる
            }
            for(j=0;j<5;j++){//星を5つ描く
                if((k=search_boss_shot())!=-1){
                    boss_shot.bullet[k].flag=1;
                    boss_shot.bullet[k].state=j;
                    boss_shot.bullet[k].cnt=0;
                    boss_shot.bullet[k].spd=0;
                    boss_shot.bullet[k].knd=10;
                    boss_shot.bullet[k].col=j;
                    boss_shot.bullet[k].angle=-PI/2+PI2/5*j;
                    boss_shot.bullet[k].x=sx;
                    boss_shot.bullet[k].y=sy;
                    boss_shot.bullet[k].vx = cos(sangle)*1.4*1.2;
                    boss_shot.bullet[k].vy = sin(sangle)*1.4;
                    boss_shot.bullet[k].base_angle[0]=sangle-PI+PI/20*bnum;
                }
            }
            bnum++;
        }
        se_flag[0]=1;
    }
   for(i=0;i<BOSS_BULLET_MAX;i++){
        if(boss_shot.bullet[i].flag>0){
            int cnt=boss_shot.bullet[i].cnt;
                        //ステータスが10未満なら
            if(boss_shot.bullet[i].state<10){
                if(t==150){//150なら星を5方向に発射
                    boss_shot.bullet[i].spd=4;//スピード
                    boss_shot.bullet[i].cnt=0;//カウンタリセット
                    boss_shot.bullet[i].state+=10;//ステータス番号変更
                }
            }
            else if(boss_shot.bullet[i].state<20){//10~19なら
                if(cnt<=80){//減速
                    boss_shot.bullet[i].spd-=0.05;
                }
                if(cnt==100){//セットした基準角度から綺麗な曲線を描く
                    boss_shot.bullet[i].angle=boss_shot.bullet[i].base_angle[0];
                }
                if(cnt>=100 && cnt<160){//加速
                    boss_shot.bullet[i].spd+=0.015;
                }
            }
        }
    }
}

//周りから中央への発射
void boss_shot_bulletH006(){
#define TM006 300
//横一列に置く弾の数
#define DNUMX006 15
    int i,j,k,t=boss_shot.cnt%TM006,t2=boss_shot.cnt;
    double xlen=FMX/DNUMX006;//画面にDNUM個並べるにはxlen間隔で並べればいい
    int dnumy=(int)(FMY/xlen);//xlenずつならべると鉛直方向にいくつはいるか
    int cnum;
    if(dnumy==0){printfDx("boss_shot_bulletH006で0割り\n"); return ;}
    double ylen=FMY/dnumy;//ylenずつおけばいい
    double x,y,angle;
    static int num;
    if(t2==0)num=0;
    if(t==0){
        x=0,y=0,angle=0,cnum=0;
        //画面左上端から 右→下→左→上 の4方向移動させる
        for(j=0;j<4;j++){
            //水平方向ならDNUMX、鉛直方向ならdnumy
            int to = j%2 ? dnumy: DNUMX006 ;
            //水平方向、鉛直方向では置く個数が違うので、to回置く
            for(i=0;i<=to;i++){
                if((k=search_boss_shot())!=-1){
                    boss_shot.bullet[k].x     = x;//座標
                    boss_shot.bullet[k].y     = y;
                    boss_shot.bullet[k].knd   = 4;//弾の種類
                    boss_shot.bullet[k].flag  = 1;
                    boss_shot.bullet[k].cnt   = 0;
                    switch(num){
                        case 0://発射種類1
                    boss_shot.bullet[k].col   = 0;//弾の色
                    boss_shot.bullet[k].angle = bossatan3(k,FMX/2,FMY/2);//角度
                    boss_shot.bullet[k].spd   = 1.3;//スピード
                    boss_shot.bullet[k].state = 0;//ステータス
                        break;
                        case 1://発射種類2
                    boss_shot.bullet[k].col   = 3;//弾の色
                    boss_shot.bullet[k].angle = bossatan3(k,FMX/2,FMY/2);//角度
                    boss_shot.bullet[k].spd   
                        = 1.4+ ((j%2 ? -1 : 1) * ((cos(PI2/to*i-PI)+1)/2))*0.4;//スピード
                    boss_shot.bullet[k].state = 1;//ステータス
                        break;
                        case 2://発射種類3
                    boss_shot.bullet[k].col   = 6;//弾の色
                    boss_shot.bullet[k].angle = bossatan3(k,FMX/2,FMY/2);//角度
                    boss_shot.bullet[k].spd   = 1.3;//スピード
                    boss_shot.bullet[k].state = 2;//ステータス
                    boss_shot.bullet[k].base_angle[0] 
                        = PI/1000 * (j%2 ? -1 : 1) * ((cos(PI2/to*i-PI)+1)/2);//加算する角度
                        break;
                    }
                    se_flag[0]=1;
                    cnum++;
                }
                x+=cos(angle)*xlen;
                y+=sin(angle)*ylen;
            }
            angle+=PI/2;
        }
    }
    for(i=0;i<BOSS_BULLET_MAX;i++){
        if(boss_shot.bullet[i].flag>0){
            int cnt=boss_shot.bullet[i].cnt;
            switch(boss_shot.bullet[i].state){
                case 2://発射種類3なら
                                        //角度を加算
                    boss_shot.bullet[i].angle+=boss_shot.bullet[i].base_angle[0];
                    break;
                default:
                    break;
            }
        }
    }
    if(t==TM006-1)
        num=(++num)%3;
}

//周りから直線発射
void boss_shot_bulletH007(){
#define TM007 300
#define DNUMX 9
    int i,j,k,s,t=boss_shot.cnt%TM007,t2=boss_shot.cnt;
    double xlen=FMX/DNUMX;//画面にDNUM個並べるにはxlen間隔で並べればいい
    int dnumy=(int)(FMY/xlen);//xlenずつならべると鉛直方向にいくつはいるか
    int cnum;
    if(dnumy==0){printfDx("boss_shot_bulletH006で0割り\n"); return ;}
    double ylen=FMY/dnumy;//ylenずつおけばいい
    double x,y,angle;
    static int num;
    if(t2==0)num=0;
    if(t==0){
        x=0,y=0,angle=0,cnum=0;
        for(j=0;j<4;j++){
            int to=j%2 ? dnumy: DNUMX ;
            for(i=0;i<=to;i++){
                for(s=0;s<2;s++){
                    if((k=search_boss_shot())!=-1){
                        boss_shot.bullet[k].x     = x;//座標
                        boss_shot.bullet[k].y     = y;
                        boss_shot.bullet[k].knd   = 4;//弾の種類
                        boss_shot.bullet[k].flag  = 1;
                        boss_shot.bullet[k].cnt   = 0;
                        switch(num){
                            case 0://直線
                        boss_shot.bullet[k].col   = 0;//弾の色
                        boss_shot.bullet[k].angle = angle+PI/2;//角度
                        boss_shot.bullet[k].spd   = 1.1+0.5*s;//スピード
                        boss_shot.bullet[k].state = 0;//ステータス
                            break;
                            case 1://斜め交差
                        boss_shot.bullet[k].col   = 3;//弾の色
                        boss_shot.bullet[k].angle = angle+PI/2-PI/14+PI/7*s;//角度
                        boss_shot.bullet[k].spd   = 1.3;//スピード
                        boss_shot.bullet[k].state = 1;//ステータス
                            break;
                        }
                        se_flag[0]=1;
                        cnum++;
                    }
                }
                x+=cos(angle)*xlen;
                y+=sin(angle)*ylen;
            }
            angle+=PI/2;
        }
    }
    if(t==TM006-1)
        num=(++num)%2;
}

//レーザーのサンプル
void boss_shot_bulletH008(){
#define TM008 420
#define DIST 60
    int i,j,k,t=boss_shot.cnt%TM008,t2=boss_shot.cnt;
    static int num;
    if(t2==0)num=4;
    if(t==0){
        for(j=0;j<2;j++){
            for(i=0;i<num;i++){
                int plmn=(j ? -1 : 1);
                if((k=search_lazer())!=-1){
                    lazer[k].col      = j;//弾の色
                    lazer[k].knd      = 0;//弾の種類
                    lazer[k].angle    = PI2/num*i+PI2/(num*2)*j+PI2/(num*4)*((num+1)%2);//角度
                    lazer[k].startpt.x= boss.x+cos(lazer[k].angle)*DIST;//座標
                    lazer[k].startpt.y= boss.y+sin(lazer[k].angle)*DIST;
                    lazer[k].flag     = 1;
                    lazer[k].cnt      = 0;
                    lazer[k].haba     = 2;//幅
                    lazer[k].state    = j;//ステータス
                    lazer[k].length   = 240;//レーザーの長さ
                    lazer[k].hantei      = 0;
                    lazer[k].lphy.conv_flag=1;//回転フラグ
                    lazer[k].lphy.conv_base_x=boss.x;//回転基準位置
                    lazer[k].lphy.conv_base_y=boss.y;
                    lazer[k].lphy.conv_x=lazer[k].startpt.x;//回転元の位置
                    lazer[k].lphy.conv_y=lazer[k].startpt.y;
                    input_lphy(&lazer[k],80,PI/num*plmn);//代入
                }
            }
        }
        se_flag[33]=1;
    }
    //レーザー計算
    for(i=0;i<LAZER_MAX;i++){
        if(lazer[i].flag>0){
            int cnt=lazer[i].cnt;
            int state=lazer[i].state;
            if(state==0 || state==1){
                if(cnt==80){
                    lazer[i].haba=30;//幅を30に
                    lazer[i].hantei=0.5;//表示幅の半分を判定範囲に
                }
                if(cnt>=260 && cnt<=320){
                    if(cnt==280)
                        lazer[i].hantei=0;
                    lazer[i].haba=10*(60-(cnt-260))/60.0;
                    if(cnt==320)
                        lazer[i].flag=0;
                }
            }
        }
    }
    if(t==TM008-1)
        num=(++num);
}

void boss_shot_bulletH009(){
#define TM009 420
#define DIST 60
    int i,j,k,s,t=boss_shot.cnt%TM009,t2=boss_shot.cnt;
    double angle;
    static int num;
    if(t2==0)num=4;
    if(t==0){
        for(j=0;j<2;j++){
            for(i=0;i<num;i++){
                int plmn=(j ? -1 : 1);
                if((k=search_lazer())!=-1){
                    lazer[k].col      = j;//弾の色
                    lazer[k].knd      = 0;//弾の種類
                    lazer[k].angle    = PI2/num*i+PI2/(num*2)*j+PI2/(num*4)*((num+1)%2);//角度
                    lazer[k].startpt.x= boss.x+cos(lazer[k].angle)*DIST;//描画し始める座標
                    lazer[k].startpt.y= boss.y+sin(lazer[k].angle)*DIST;
                    lazer[k].flag     = 1;//表示するか 0:しない 1:する
                    lazer[k].cnt      = 0;
                    lazer[k].haba     = 2;//幅
                    lazer[k].state    = j;//
                    lazer[k].length   = 310;//長さ
                    lazer[k].hantei      = 0;//あたり判定をするか 0:しない 1:する
                    lazer[k].lphy.conv_flag=1;//回転するか 0:しない 1:する
                    lazer[k].lphy.conv_base_x=boss.x;//回転の基準となる座標
                    lazer[k].lphy.conv_base_y=boss.y;
                    lazer[k].lphy.conv_x=lazer[k].startpt.x;//回転するレーザーの位置
                    lazer[k].lphy.conv_y=lazer[k].startpt.y;
                    input_lphy(&lazer[k],80,PI/num*plmn);//k番目のレーザーを、80カウントで、PI/num*plmnの角度だけ回転する情報を登録
                }
            }
        }
        se_flag[33]=1;
    }
    //60カウント以下で10カウントに1回
    if(t==50){
        angle=rang(PI);//自機とボスとの成す角
        for(s=0;s<2;s++){
            for(t=0;t<3;t++){
                for(j=0;j<3;j++){
                    for(i=0;i<30;i++){
                        if((k=search_boss_shot())!=-1){
                            boss_shot.bullet[k].col   = s;//弾の色
                            boss_shot.bullet[k].x     = boss.x;//座標
                            boss_shot.bullet[k].y     = boss.y;
                            boss_shot.bullet[k].knd   = 11;//弾の種類
                            boss_shot.bullet[k].angle = angle+PI2/30*i+PI2/60*s;//角度
                            boss_shot.bullet[k].flag  = 1;
                            boss_shot.bullet[k].cnt   = 0;
                            boss_shot.bullet[k].spd   = 1.8-0.2*j+0.1*s;//スピード
                            boss_shot.bullet[k].eff   = 0;
                            boss_shot.bullet[k].state   = t;
                        }
                        se_flag[0]=1;
                    }
                }
            }
        }
    }
    if(t>=170 && t<310 && (t-170)%35==0){
        int div=((t-170)%70==0) ? -1 : 1;
        angle=rang(PI);//自機とボスとの成す角
        for(s=0;s<2;s++){//速度の違う2つの弾がある
            for(t=0;t<3;t++){//1箇所から3つにわかれる
                for(i=0;i<30;i++){//1周30個
                    if((k=search_boss_shot())!=-1){
                        boss_shot.bullet[k].col   = 2;//弾の色
                        boss_shot.bullet[k].x     = boss.x;//座標
                        boss_shot.bullet[k].y     = boss.y;
                        boss_shot.bullet[k].knd   = 11;//弾の種類
                        boss_shot.bullet[k].angle = angle+PI2/30*i;//角度
                        boss_shot.bullet[k].flag  = 1;
                        boss_shot.bullet[k].cnt   = 0;
                        boss_shot.bullet[k].spd   = 2-0.3*s;//スピード
                        boss_shot.bullet[k].eff   = 0;
                        boss_shot.bullet[k].state = 10+t;
                        boss_shot.bullet[k].base_angle[0] = PI/300*div;
                    }
                }
            }
            se_flag[0]=1;
        }
    }
    if(t==360){
        angle=rang(PI);//自機とボスとの成す角
        for(t=0;t<3;t++){//1箇所から3つに分かれる
            for(i=0;i<30;i++){
                if((k=search_boss_shot())!=-1){
                    boss_shot.bullet[k].col   = 1;//弾の色
                    boss_shot.bullet[k].x     = boss.x;//座標
                    boss_shot.bullet[k].y     = boss.y;
                    boss_shot.bullet[k].knd   = 0;//弾の種類
                    boss_shot.bullet[k].angle = angle+PI2/30*i;//角度
                    boss_shot.bullet[k].flag  = 1;
                    boss_shot.bullet[k].cnt   = 0;
                    boss_shot.bullet[k].spd   = 1.8;//スピード
                    boss_shot.bullet[k].eff   = 1;
                    boss_shot.bullet[k].state = 20+t;
                }
            }
        }
        se_flag[0]=1;
    }
    for(i=0;i<BOSS_BULLET_MAX;i++){
        if(boss_shot.bullet[i].flag>0){
            int cnt=boss_shot.bullet[i].cnt;
            int state=boss_shot.bullet[i].state;
            if(state%10==0){
                if(cnt>90 && cnt<=100)
                    boss_shot.bullet[i].spd-=boss_shot.bullet[i].spd/220;
            }
            if(state%10==1){
                if(cnt>50)
                    boss_shot.bullet[i].spd+=boss_shot.bullet[i].spd/45;
            }
            if(state%10==2){
                if(cnt>65)
                    boss_shot.bullet[i].spd+=boss_shot.bullet[i].spd/90;
            }
            if(10<=state && state<=12){
                if(cnt>15 && cnt<=80)
                    boss_shot.bullet[i].angle+=boss_shot.bullet[i].base_angle[0];
            }
        }
    }
    for(i=0;i<LAZER_MAX;i++){
        if(lazer[i].flag>0){
            int cnt=lazer[i].cnt;
            int state=lazer[i].state;
            if(state==0 || state==1){
                if(cnt==80){
                    lazer[i].haba=10;
                    lazer[i].hantei=0.5;
                }
                if(cnt>=260 && cnt<=320){
                    if(cnt==280)
                        lazer[i].hantei=0;
                    lazer[i].haba=10*(60-(cnt-260))/60.0;
                    if(cnt==320)
                        lazer[i].flag=0;
                }
            }
        }
    }
    if(t==TM009-1)
        num=(++num);
}

//深弾幕結界
void boss_shot_bulletH010(){
#define TM010 9000 //最大周期(特に設定する意味は無い)
#define DIST010  (FMX/2*1.18) //chidlが1周目円運動する大きさ
#define DIST0101 (FMX/2*0.95) //childが2周目に円運動する大きさ
#define HANSHU2_0 180 //childが半周する時間
#define HANSHU2_1 120 //childが半周する時間
#define HANSHU 120 //childが1周目に半周する時間
#define HANSHU1 180 //childが2周目に半周する時間
#define GOOUT010 90    //childが中央から外へ行く時間
#define KAISHI010 (HANSHU) //chidlが発射を開始する時間
#define KAISHI010_1 (HANSHU1*0.6)
#define CHILD_TIME (HANSHU*5+HANSHU/3)            //childが存在する時間
#define CHILD_TIME1 (HANSHU1*3+HANSHU1*0.4)            //childが存在する時間
#define CHILD_SHOT_TIME (CHILD_TIME-KAISHI010)//childが実際に発射している時間
#define CHILD_SHOT_TIME1 (CHILD_TIME1-KAISHI010_1)//childが実際に発射している時間
#define ANG0 PI/9 //1周目の角度
#define ANG1 PI/6 //2周目の角度
#define TIME1 900 //1周目が終わる時間
#define RAG 20 //外に発射されて内に発射されるまでのラグ
#define TERM0 20 //全て発射されてから動き出すまでの時間
#define ST_ED 130 //最初に動き出してから最後の弾が動き出すまでの時間
#define ST0 (CHILD_SHOT_TIME+TERM0) //最初の弾が動く次官
#define ED0 (CHILD_SHOT_TIME+TERM0+ST_ED) //最後の弾が動く時間
#define TERM1 47
#define ST_ED1 105
#define ST1 (CHILD_SHOT_TIME1+TERM1)
#define ED1 (CHILD_SHOT_TIME1+TERM1+ST_ED1)

    int i,j,k,t=boss_shot.cnt%TM010,t2=boss_shot.cnt;
    int tt1=boss_shot.cnt-TIME1;
    static int num,flag,knum;
    static double child_dist,child_angle,child_dist2,child_angle2;
    if(t2==0){//最初なら
        input_phy_pos(FMX/2,FMY/2, 50);
        num=-1;
        flag=0;
    }
    //周期の最初
    if(t==0 || t2==TIME1){
        num++;
        //childデータの初期化
        child_dist=0;
        child_angle=0;
        child_dist2=0;
        child_angle2=0;
        knum=0;
    }
    //childの登録
    if(t2==GOOUT010 || t2==TIME1){
        int j=2;
        for(i=j-2;i<j;i++){
            child[i].flag =1;
            child[i].x      =boss.x;
            child[i].y      =boss.y;
            child[i].range=0.5;
            child[i].spd  =1;
            child[i].angle=0;
            child[i].knd  =0;
            child[i].col  =0;
            child[i].cnt  =0;
            child[i].state=i;
        }
    }
    //1周目
    if(num==0){
        if(GOOUT010<=t){
            //出現してから外向きに広がっていくまで
            if(GOOUT010<=t && t<GOOUT010+KAISHI010)
                child_dist+=DIST010/KAISHI010;
            //常に回転
            child_angle+=PI/HANSHU;
        }
    }
    //2周目
    if(num==1){
        //出現してから外向きに広がっていくまで
        if(child[0].cnt<KAISHI010_1)
            child_dist+=DIST0101/KAISHI010_1;
        //常に回転
        child_angle-=PI/HANSHU1;
    }
    //childデータ計算
    for(i=0;i<CHILD_MAX;i++){

Re: 龍神録プログラミングの館 36章

Posted: 2011年5月29日(日) 15:46
by softya(ソフト屋)
CHILD_MAXの定義ミスって事はないでしょうか?

Re: 龍神録プログラミングの館 36章

Posted: 2011年5月29日(日) 16:33
by qhqh
define.hでの定義と言う事でしょうか?
もしそうならば出来ていると思います。

Re: 龍神録プログラミングの館 36章

Posted: 2011年5月29日(日) 18:10
by softya(ソフト屋)
エラーが出る以上は何処かに間違いがあります。
本当に
#define CHILD_MAX 20
となっていますか?セミコロンとかないでしょうか?

これでも無いとしたら、boss_shoth.cppソース全体を貼ってもらうしか無いですね。
最初のはcodeタグで[]を書き忘れていたので加えてあります。ご注意ください。

Re: 龍神録プログラミングの館 36章

Posted: 2011年5月29日(日) 18:29
by qhqh
すみません、なぜか20を書き忘れていました。 お恥ずかしいかぎりです。
codeと/codeの間に[]を入れるんですね、今度から気をつけます。
返信してくださった方、本当にありがとうございました。