currently i am making a game which has doors that open if you touch it and press e
this is the code
(btw this is the code from the character)
how would i make this so i can open it
it also says this in the allowCollision() in door closed
public void act()
{
if (Greenfoot.isKeyDown("e") && (isTouching (OpenableDoor.class)))
{
openDoor();
}
else
{
closeDoor();
}
}
public void openDoor()
{
allowCollision();
}
public void closeDoor()
{
DoorClosed();
}
public boolean DoorClosed()
{
if (allowCollision() = false)
{
int spriteWidth = getImage().getWidth();
int xDistance = (int) (spriteWidth/2);
Actor closeDoor = getOneObjectAtOffset (xDistance, 0, OpenableDoor.class);
if (closeDoor == null)
{
return false;
}
else
{
stopByOpenableDoor(closeDoor);
return true;
}
}
}
public void stopByOpenableDoor(Actor closeDoor)
{
int wallWidth = closeDoor.getImage().getWidth();
int newX = closeDoor.getX() -(wallWidth + getImage().getWidth())/2;
setLocation(newX , getY());
}
public boolean allowCollision()
{
}unexpected type
required: variable
found: value


