Hi everyone in my game I'm trying to make a door open with a key i put it like this.
I have a class door, a class Player and a class key and i put it like thisIt's not working i have a java.lang.NullPointerException when i touch the door can anyone help please thanks
private boolean key = false;
public void key()
{
if(isTouching(key.class))
{
boolean key = true;
}
}
public void remove_door()
{
if(isTouching(door.class))
{
if(key=true)
{
w1.removeObject(d);
}
}
}

