示例#1
0
  /**
   * Create a new board
   *
   * @param c
   */
  public Board(Game c) {
    // add leap motion controller
    leapAdapter = new SensorAdapter(c);
    sensorListener = new SensorListener(leapAdapter);
    shootListener = new ShootListener(leapAdapter);
    leapController = new Controller();
    leapController.addListener(sensorListener);
    leapController.addListener(shootListener);

    addKeyListener(new KeyboardAdapter(c, this));

    this.menu = new Menu(this, c);
    setFocusable(true);
    setDoubleBuffered(true);
    this.c = c;
    c.setPlayer(ItemFactory.createPlayer());
    c.setBackground(ItemFactory.createBackground());
  }