In my project, I'm trying to add 1 to the score when my main actor passes another actor. Can someone help please?
counterBart++;
if(counterBart == 40){
score1.setScore(score);
Bart b = new Bart();
if (b.getX() == 100){
score++;
}
int y = rand.nextInt(350)+50;//Creates random placement of Burns on Y-axis with 50 pixels on top and bottom of area of space
GreenfootImage bimage = b.getImage();
addObject(b, getWidth(), y);
System.out.println(counterBart);
counterBart = 0;
}

