I have a problem i want to write that if Mario is dead that a winner images for luigi appear and on the otherway the same.
i wrote:
The problem with this code is that every time just the mario image appear. need help pls..!!!!
public void act() { if (marioDead()) { winnerLuigi(); } if (luigiDead()) { winnerMario(); } } public void winnerMario() { List objekte = getObjects(null); removeObjects(objekte); setBackground("winnerMario.jpg"); } public void winnerLuigi() { List objekte = getObjects(null); removeObjects(objekte); setBackground("winnerLuigi.jpg"); } public boolean marioDead() { return getObjects(Bomber1.class).isEmpty(); } public boolean luigiDead() { return getObjects(Bomber2.class).isEmpty(); }