I just added an outside to Lana's House. I want players to only be able to enter if front door is open (image2)
In my checkNextLevel method I added:
if (getY() < 100) {
if (level == 1) {
if (getWorld.getDoor =(image 2)) // This is the line I need help with.
{
level = 4;
getWorld().removeObject(this);
Greenfoot.setWorld(new Level4(this));}
else {
level = 1;
getWorld().removeObject(this);
Greenfoot.setWorld(new Level1(this));}
}
}
Do I need to get to Door class to find out if it is open?
Can I go a shorter route ie, getActor.getDoor?
Is there a method that asks for image condition?
Thanks.

