For some reason my boolean is True from second one i run the game not only when at the certain X and Y. I probably need to change the void but i dont know into where (i know void can't return).
public boolean Cargo = true; public void act() { if(!getWorld().getObjects(MainBoat.class).isEmpty()) { Actor boat = (Actor)getWorld().getObjects(MainBoat.class).get(0); if (boat.getX()>=102 && boat.getX() <= 136 && boat.getY()==729){ Cargo = true; } else { Cargo = false; } } } public void BoatExit() { if(Cargo = true) { System.out.println("hje"); } else { System.out.println("anus"); } }