I need to link to a Loose variable i have in my Actor, in my World. But i can't figure out how to link it, it doesn't recognize it in my World.
Do i need some special code?
This is the one i need to link
public boolean getLoose() { Actor Ghost1 = getOneObjectAtOffset( 0, 0, Ghost1.class); Actor Ghost2 = getOneObjectAtOffset( 0, 0, Ghost2.class); Actor Ghost3 = getOneObjectAtOffset( 0, 0, Ghost3.class); Actor Ghost4 = getOneObjectAtOffset( 0, 0, Ghost4.class); if(Ghost1 != null){ return true; } else if (Ghost2 != null){ return true; } else if (Ghost3 != null){ return true; } else if (Ghost4 != null){ return true; } else{ return false; } }
public void Loose() { if(getLoose()){ addObject(new ScoreBoard(800, 600), getWidth() / 2, getHeight() / 2); } }