Trying to pass a parameter from actor A, to the world, to actor B. Actor A's act method runs this: The world receives it: The world sends it: The actor receives it:
The thing that isn't working though, is actor A's position is correct when it is sent to the world for tie and sword, but NOT for enemy. I'm not sure why, but setting the condition "if(enemyCount >= 1)" seems to disrupt the flow and it doesn't work. Any thoughts?
if(getWorld() instanceof levelOne) { levelOne currentLevel = (levelOne)getWorld(); currentLevel.updateNinjaPosition(getX(), getY()); }
public void updateNinjaPosition(int x, int y) { ninjaX = x; ninjaY = y; }
public void updateFollowers() { sword.ninjaInfo(ninjaX, ninjaY); tie.ninjaInfo(ninjaX, ninjaY); if(enemyCount >= 1) { enemy.getInfo(ninjaX, ninjaY); } }
public void getInfo(int x, int y) { ninjaX = x; ninjaY = y; }