title: contactListener does not work , how to implement it?
body: <p>I am trying to implement the method beginContact contactlistener class , but I have some doubts about it .
  I'm new to libgdx and I can not figure out how to " leave" the method that controls the contacts .
  in my project I have a Stage that manages the actors .
  I looked online and found that I have to add World .
  but I can not understand the concept , why :)</p>
  
  <p>Some good soul can help me? Thank You</p>
  
  <pre><code>   public void create() {
      stage = new Stage();
      Gdx.input.setInputProcessor(stage);
      world = new World(new Vector2(0,-10), true);
      world.setContactListener(contactlistener);
  
      //meteora
      meteora = new Image(new TextureRegion(new Texture(Gdx.files.internal("planet.png")), 128, 128));
      meteora.setOrigin(meteora.getWidth() / 2, meteora.getHeight() / 2);
      meteora.setPosition(Gdx.graphics.getWidth() / 2, 100);
      meteora.setZIndex(3);
  
  
      group = new Group();
      group.addActor(spaceShip);
      group.addActor(flagShip);
      group.setZIndex(3);
      group.setWidth(98);
      group.setHeight(128);
      group.setOrigin(group.getWidth() / 2, group.getHeight() / 2);
      group.setPosition(Gdx.graphics.getWidth() / 2, Gdx.graphics.getHeight() / 2);
  
      stage.addActor(group);
      stage.addActor(meteora);
  }
  
  public void render() {
      Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
      stage.act(Gdx.graphics.getDeltaTime());
      stage.draw();
      /*....other code....*/
  }
  
  ContactListener contactlistener = new ContactListener() {
      @Override
      public void beginContact(Contact contact) {
          final Fixture x1 = contact.getFixtureA();
          final Fixture x2 = contact.getFixtureB();
  
          System.out.println(x1.getUserData());
          System.out.println(x2.getUserData());
  
          if ( (x1.equals("gruppo") &amp;&amp; x2.equals("planet")) || (x1.equals("planet") &amp;&amp; x2.equals("gruppo")) )
              System.out.println("shot");
      }
  
      @Override
      public void endContact(Contact contact) {
  
      }
  
      @Override
      public void preSolve(Contact contact, Manifold oldManifold) {
  
      }
  
      @Override
      public void postSolve(Contact contact, ContactImpulse impulse) {
  
      }
  };
  </code></pre>