import java.util.Vector;

public class GameFrame extends MyFrame {
    public void run() {
        GameWorld.player=new Player(100, 300, 0, 0);
        addKeyListener(GameWorld.player);
        GameWorld.playerBullets=new Vector<PlayerBullet>();
        while (true) {
            clear();
            GameWorld.player.draw(this);
            GameWorld.player.move();
            movePlayerBullets(); // 変更
            sleep(0.03);
        }
    }
    public void movePlayerBullets() { // 追加ここから
        int i=0;
        while (i<GameWorld.playerBullets.size()) {
            PlayerBullet b=GameWorld.playerBullets.get(i);
            b.draw(this);
            b.move();
            if (b.y<0) {
                GameWorld.playerBullets.remove(i);
            } else {
                i++;
            }
        }
    }// 追加ここまで
}
