Hi guys, i was programming a game for a schoolproject but now i definitly stuck, i have to stop a sinlge method before it Comes to the next one :
Tih is my Code :
public void act()
{
if(isAtEdge()){
getWorld().removeObject(this);
//here the Code of the object (not the hole game) has to stop if isatedge is true and the object has been removed
}
movement();
monsterkiller();
}
public void monsterkiller(){
if(isTouching(monster.class)){
removeTouching(monster.class);
getWorld().removeObject(this);
//here the Code has to stop if isTouching is true and the object has been removed
}
}
public void movement(){
setRotation(270);
move(5);
}
at the 2 places with the // i can't find a way to stop only this Code of this object i can just stop the hole game by Greenfoot.stop
I would be really thankfull for help
Julian

