I want to check if the variable f of the actor next to it (of the same class) equals 1 and if it does i want to change the variable f of the current actor to 1 aswell but I get the error "can not find symbol - variable f" and I dont know how to fix it. pls help
public class block extends Actor{
int f = 0;
public void act() {
setRotation(90);
bewegen();
}
public void bewegen(){
if(Greenfoot.isKeyDown("a")){
if(getX() > 2 && getX() < 11){
setLocation(getX()-1,getY());
}
}
if(Greenfoot.isKeyDown("d")){
if(getX() > 2 && getX() < 11){
setLocation(getX()+1,getY());
}
}
if(getY()<22 && getOneObjectAtOffset(0,1,block.class)==null){
move(1);
}
}
public void check(){
Actor b1 = getOneObjectAtOffset(1, 0, block.class);
if(b1 != null){
if(b1.f == 1){
f = 1;
}
}
}
}
