[LibGDX] Box2DMapObjectParser detect a collision to finish game

hello
I’m using Box2DMapObjectParser to create a object Layer in a tiled map where i create line shaped objects to represent borders.
the problem is i do not know how to end the stage .
like f the player object hits the final line the game should end … etc.

any one can help me please ?

Pseudo

if (player x || player y > tile x || tile y){
 \\ do somethine
}

Just need to find out what tile is the last one.

thank you, that helped me a lot
my final method was like :


if (player.getBox().getPosition().y >= 378){

since i only need vertical location , and .getBox method will return a Box2D body which contains the player.

Just bare in mind for future, if your character is on the left side of an object. You need to add the width of the character into the x, if the origin is the bottom left.

Same goes for y axis, character + height.

Think about it if you don’t understand why.