Hello, my problem is named in the title. I unterstand what the message wants to tell me but i don't know a way around it. I hope somebody can help me. Here's the method with the error:
public void powerUp() { Figur figur = getOneIntersectingObject(Figur.class); if(figur != null && figur.yRichtung == 1) { if(figur.status == "babyFigur") { World dieseWelt = getWorld(); RoterPilz roterPilz = new RoterPilz(); dieseWelt.addObject(roterPilz, this.getX(), this.getY()-24); AktiviertesFragezeichen aktiviertesFragezeichen = new AktiviertesFragezeichen(); dieseWelt.addObject(aktiviertesFragezeichen, 0, 0); dieseWelt.removeObject(this); } } }