オプションを選択したいのですが…
Posted: 2015年7月22日(水) 12:30
スタート画面でaを押せばAの装備に、bを押せばBの装備に
なるようにしたいのですが
main.cppに以下のようにして選択画面を作ってその後
cshot.cppで使い分けて使おうとしたところ
ショットが打てないという事態に陥ってしまいました。
初心者なんでがばがばだと思うので、
訂正や関数の使い方など教えていただけると嬉しいです。
main.cpp
cshot.cpp
なるようにしたいのですが
main.cppに以下のようにして選択画面を作ってその後
cshot.cppで使い分けて使おうとしたところ
ショットが打てないという事態に陥ってしまいました。
初心者なんでがばがばだと思うので、
訂正や関数の使い方など教えていただけると嬉しいです。
main.cpp
void Ch_shootkind(int s){
if(CheckStateKey(KEY_INPUT_A)==1){
s = 0;
func_state=99;
}
if(CheckStateKey(KEY_INPUT_B)==1){
s = 1;
func_state=99;
}
}
//////////////////////////////////////////////////////////////////////////////////////////////////
case 90://start
Color = GetColor( 255 , 255 , 255 ) ;
DrawFormatString(215,175,Color,"you can start the game.");
DrawFormatString(255,195,Color,"option A -> a");
DrawFormatString(255,215,Color,"option B -> b");
Ch_shootkind();
break;
//////////////////////////////////////////////////////////////////////////////////////////////////
void enter_shot(){
if(Ch_shootkind = 0){
//ショットボタンが押されていたら
if(CheckStatePad(configpad.shot)>0){
ch.shot_cnt++;
if(ch.shot_cnt%3==0){//3カウントに1回
if(CheckStatePad(configpad.slow)>0)//低速移動中なら
ch0_shot1_pattern();
else
ch0_shot0_pattern();
}
else
ch.shot_cnt=0;
}
}else if(Ch_shootkind = 1){
if(CheckStatePad(configpad.shot)>0){
ch.shot_cnt++;
if(ch.shot_cnt%3==0){//3カウントに1回
if(CheckStatePad(configpad.slow)>0)//低速移動中なら
ch1_shot1_pattern();
else
ch1_shot0_pattern();
}
else
ch.shot_cnt=0;
}
}
}