自機ショット

フォーラム(掲示板)ルール
フォーラム(掲示板)ルールはこちら  ※コードを貼り付ける場合は [code][/code] で囲って下さい。詳しくはこちら
ディア

自機ショット

#1

投稿記事 by ディア » 16年前

以下のソース内で、
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:自機ショット

#2

投稿記事 by でんすけ » 16年前

構造体の中身を確認してみてください
// キャラクターに関する構造体
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:自機ショット

#3

投稿記事 by ディア » 16年前

解決しました!ありがとうございます!

閉鎖

“C言語何でも質問掲示板” へ戻る