Hello there, I need help changing the int rn from my subclass 'Groundside'; here are my classes(Placer, Ground & Groundside).
Placer:
Ground:
and finally, Groundside:
I am trying to change the static int 'rn' from the subclass 'Groundside'
public class Placer extends GifActor
{
static int rn;
static int gsy;
static boolean rnc;
static boolean getRNC()
{
return rnc;
}
static void setRNC(boolean type)
{
rnc = true;
}
public void act()
{
}
}public class Ground extends Placer
{
boolean costume;
boolean random=false;
public void addedToWorld(World world)
{
gsy= getY();
setImage("building2.gif");
}
public void act()
{
super.act();
setLocation(getX() - 4, getY());
boolean random=false;
{
rn=Greenfoot.getRandomNumber(300)+200;
{
if (getX()<10)
{
setLocation(590,rn);
rnc=false;
}
if(getX()>10)
{
rnc=true;
}
if (getY()>275)
{
setImage("building2.gif");
}
else if(getY()<275)
{
setImage("building1.gif");
}
if(getY()<275)
{
setLocation(getX(),270);
}
}
}
}}public class Groundside extends Placer
{
public void addedToWorld(World world)
{
}
static boolean getRNC()
{
return rnc;
}
public void act()
{
setLocation(getX() - 4, getY());
boolean random=false;
{
{
if (random=true&&rn<200)
{
random = false;
}
if (getX()<10)
{
setLocation(590,rn);
random=true;
}
}
}}}