Hello,
I need some help with this code (the world is 8 x 8):
I don't know how to write that greenfoot should integrate the name in the string actor.
Is there someone who could help me? :)
public int numberOfActors(String actor) { int beginX = getX(); int beginY = getY(); int numberActor = 0; for(int x = 0; x < 8; x++) { for(int y = 0; y < 8; y++) { setLocation(x,y); if(isTouching( ??? .class)) { numberActor++; } } } setLocation (beginX,beginY); return anzahlActor; }