So I'm making a labyrinth game and I have troubles detecting the object when it is at the exit.
Basically, it is exactly one cell where the player has to be standing to trigger the loading of the next level. Being in the World Class, I thought of using
But in this case it triggers the second level instantly without even standing on the right cell (which is defined earlier on). Is it possible that getObjetsAt() always returns NOT null?
How could I make the game detect if the player is standing exactly at one cell and then make it trigger the next level?
if (getObjectsAt(winX, winY, Player.class) !=null) {
loadLv2();
}


