ページ 11

自機ショット

Posted: 2009年9月17日(木) 17:58
by ディア
以下のソース内で、
56行 'shot_cnt' は 'ch_t' のメンバーではない(関数 enter_shot() )
57行 'shot_cnt' は 'ch_t' のメンバーではない(関数 enter_shot() )
65行 'shot_cnt' は 'ch_t' のメンバーではない(関数 enter_shot() )

とエラーが発生するのですが、
対処法がわかりません。
どなたか教えてください。

52  //ショット登録部
53  void enter_shot(){
54          //ショットボタンが押されていたら
55          if(CheckStatePad(configpad.shot)>0){
56                  ch.shot_cnt++;
57                  if(ch.shot_cnt%3==0){//3カウントに1回
58                          if(CheckStatePad(configpad.slow)>0)//低速移動中なら
59                                  ch1_shot_pattern();
60                          else
61                                  ch0_shot_pattern();
62                  }
63          }
64          else
65                  ch.shot_cnt=0;
66  }

Re:自機ショット

Posted: 2009年9月17日(木) 18:23
by でんすけ
構造体の中身を確認してみてください
// キャラクターに関する構造体
typedef struct
{
	int flag;
	int cnt;
	int power;
	int point;
	int score;
	int num;
	int mutekicnt;
	int shot_mode;
	int shot_cnt;   // これを追加してやる
	int money;
	int img;
	int slow;	
	double x, y;
}ch_t;

Re:自機ショット

Posted: 2009年9月17日(木) 18:51
by ディア
解決しました!ありがとうございます!