Пример #1
0
  public void init() {
    // final width = 1366 ;
    // final height = 744 ;
    this.setTitle("ARKANOID");
    this.setSize(width + 300, height);
    this.setVisible(true);
    this.addWindowListener(
        new WindowAdapter() {
          public void windowClosing(WindowEvent e) {
            System.exit(0);
          }
        });
    addKeyListener(
        new KeyAdapter() {
          @Override
          public void keyPressed(KeyEvent e) {
            super.keyPressed(e);
            ship.addMove(e);
          }
        });
    imageDB = new BufferedImage(getWidth() + 300, getHeight(), BufferedImage.TYPE_INT_RGB);
    graphDB = imageDB.getGraphics();

    sound = new Sound();
    run();
  }