So if the (Essen = trans. Food) is been eaten by the Crab, a static point system has to increase (+1)
Thats my pointsystem. And i have copied my Project. (Original and a copy of this where i can work on) . In this Copy the score doesnt increase. The script should work. And in the Original the Script works too. Here my script:
if(d<5){d++;} if(d == 1){op = 0;}
if (isTouching(Craby.class)){ op++; if(getWorld() instanceof CrabWorldSlither){
getWorld().showText("Score:"+ op,200,300);
setLocation(Greenfoot.getRandomNumber(850),Greenfoot.getRandomNumber(550));}
if(getWorld() instanceof CrabWorld){ getWorld().removeObject(this);}}
Static();