so basically I'm working on this for school for a project and whenever a laser hits an apple, the terminal window pops up and I get a message saying null pointer exception on my laser. The specific line is
getWorld().getObjects(Laser.class) != null && shouldBeRemoved()
and shouldBeRemoved():
public boolean shouldBeRemoved(){ // checks boundaries
boolean checkY = getY() - getImage().getHeight()/2 < 0;
System.out.println(checkY);
if(checkY == true){
return true;
}
return false;
}
and I don't know why I'm getting the exception. Can anyone help me?
