title: LibGdx Box2d Platformer Jump implementation
body: <p>I am using Box2D in LibGdx to create a platformer game.I have an algorithm which converts tiles to fixtures.And i am using Contact Listener to determine if the player is in the air or not, but the problem is, because i am using fixtures that are next to each other,</p>
  
  <pre><code>(P)--&gt;
  </code></pre>
  
  <p>|tile| |tile| |tile|</p>
  
  <p>contact listener calls contact end after calling contact begin when i pass the adjacent tile and sets MOB_AIR value to true resulting i can't jump even though i'm on the ground.</p>
  
  <p>Other parts of the code (mob and box2d world) works fine, because i can jump when i'm newly landed or in-between the tiles.</p>
  
  <p>If you experienced the same issue before, is there a good way to implement this jumping?</p>
  
  <p><a href="http://i.imgur.com/v8ny3sO.png" rel="nofollow">http://i.imgur.com/v8ny3sO.png</a></p>
  
  <p><a href="http://i.imgur.com/yWcDsZb.png" rel="nofollow">http://i.imgur.com/yWcDsZb.png</a></p>
  
  <p>sorry for my bad English, any helps will be appreciated.</p>
  
  <p>PS: Also problem is not about due box2d polygon-polygon collison glitches, i use chainshape for player and polygons for tiles.
  `</p>
  
  <pre><code>        public void beginContact(Contact contact) {
              Fixture x1 = contact.getFixtureA();
              Fixture x2 = contact.getFixtureB();
  
              if(x1.getUserData()!=null &amp;&amp; x2.getUserData()!=null){
                  if(x1.getUserData().equals("sensor") &amp;&amp; x2.getUserData().equals("x")){
                      mob.setState(Mob.ON_AIR, false);
                  }
  
                  else if(x2.getUserData().equals("sensor") &amp;&amp; x1.getUserData().equals("x")){
                      mob.setState(Mob.ON_AIR, false);
                  }
              }
  
          }
  
          @Override
          public void endContact(Contact contact) {
              Fixture x1 = contact.getFixtureA();
              Fixture x2 = contact.getFixtureB();
  
              if(x1.getUserData()!=null &amp;&amp; x2.getUserData()!=null){
                  if(x1.getUserData().equals("sensor") &amp;&amp; x2.getUserData().equals("x")){
  
                      mob.setState(Mob.ON_AIR, true);
  
                  }
                  else if(x2.getUserData().equals("sensor") &amp;&amp; x1.getUserData().equals("x")){
  
                      mob.setState(Mob.ON_AIR, true);
                  }
              }
          }`
  </code></pre>