break文
Posted: 2009年5月04日(月) 14:10
初歩的な質問ですいませんが
違いはbreakなのですが、
しただと連続で弾がでないで
うえだと連続で玉が出ます。
if( CheckHitKey( KEY_INPUT_Z ) == 1 && count%5==0){ for(int j=0;j<Player_shot_max2;j++){ if(player_shot[0][j].flag==0){ player_shot[0][j].flag=1; player_shot[0][j].x=player.x; player_shot[0][j].y=player.y; break; } } }と
if( CheckHitKey( KEY_INPUT_Z ) == 1 && count%5==0){ for(int j=0;j<Player_shot_max2;j++){ if(player_shot[0][j].flag==0){ player_shot[0][j].flag=1; player_shot[0][j].x=player.x; player_shot[0][j].y=player.y; } } }では処理がどう違うのでしょうか?
違いはbreakなのですが、
しただと連続で弾がでないで
うえだと連続で玉が出ます。