Yehuda wrote...
Have lines 4 and 5 just be:
int yenPerMin;
// then add the following method into the class
protected void addedToWorld(World world) {
yenPerMin = world.MKLevel * 8192;
}import greenfoot.*;
public class MgrKanau extends Actor
{
int YenPerMin;
protected void addedToWorld(MyWorld mw)
{
YenPerMin = mw.MKLevel*8192;
}
public void act()
{
if(getWorld().getObjects(MgrKanau.class).size() != 0) GainYen();
}
public void GainYen()
{
MyWorld mw = (MyWorld)getWorld();
float YenAdjustment = 0; // every cycle this value will pe deposited onto the world's yen value
Greenfoot.setSpeed(50);
YenAdjustment += YenPerMin / 60f /50;
mw.adjustYen(YenAdjustment);
// When buying something, only subtract the price from AGold!
}
}


