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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | 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 ; } } |
1 2 3 4 5 6 7 8 9 | public void Loose() { if (getLoose()){ addObject( new ScoreBoard( 800 , 600 ), getWidth() / 2 , getHeight() / 2 ); } } |