title: LibGDX - Collisions error (player with rectangles)
body: <p>I think that's a simple error, but I've crashed my mind thinking about it and I can't do it.
  I don't know why when I jump with the player and collides with another rectangle (platform) the player appears above it.</p>
  
  <pre><code>        for(RectangleMapObject rectangleObject : map.getLayers().get("platform").getObjects().getByType(RectangleMapObject.class)){
  
          Rectangle rectangle = rectangleObject.getRectangle();
  
          float x = rectangle.x;
          float y = rectangle.y;
          float width = rectangle.width;
          float height = rectangle.height;
  
          shapeRenderer.rect(x, y, width, height);
  
          //TODO: Finish tile's physics
          if(Intersector.overlaps(rectangle, nihanRect)) {
              if (velocity.y &gt; 0) {
                  nihan.getVelocity().y = 0;
                  nihan.getPosition().y = y - height - Constants.NIHAN_HEIGHT - 10;
  
  
                  nihan.setCollisions(false);
                  nihan.setAvailableJump(false);
              } else {
                  nihan.getPosition().y = y + height - 0.5f;
                  nihan.setCollisions(true);
  
                  nihan.setAvailableJump(true);
  
                  if(Gdx.input.isKeyPressed(Input.Keys.Z)){
                      nihan.getPosition().y = y + height;
                  }
              }
              nihan.getVelocity().y = 0;
  
              Gdx.app.log(TAG, "Collision produced!");
  
  
  
  
          }else{
              nihan.setCollisions(false);
  
          }}
  </code></pre>
  
  <p>Sorry if my english is bad, I'm a spanish speaker.
  Greetings!</p>
  
  <p><a href="https://i.stack.imgur.com/vAtZv.png" rel="nofollow noreferrer">When the player is standing</a> -->
  <a href="https://i.stack.imgur.com/KDFB7.png" rel="nofollow noreferrer">After jumping the player appears in the top of the platform</a></p>