This site requires JavaScript, please enable it in your browser!
Greenfoot back
ITStudent
ITStudent wrote ...

2019/11/17

Greenfoot Bug??? (Again)

ITStudent ITStudent

2019/11/17

#
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();
ITStudent ITStudent

2019/11/17

#
oh and public static int op;
ITStudent ITStudent

2019/11/17

#
and Static(){return op;}
ITStudent ITStudent

2019/11/17

#
Okay, so i had made a new static int PO and now its working fine. Maybe it was a bug from Greenfoot
You need to login to post a reply.