No, i was wrong. Its not the 40th line inside of Mesto enabeling spaming scores, but i think it need to be fixed inside if sentence (26 line) of Letalo class
public class Mesto extends Actor
{
private Actor cityImage = new SimpleActor();
private GreenfootSound hoverSound;
public boolean spaceDown;
public Mesto(String ime){
setImage("mesto.jpg");
hoverSound = new GreenfootSound(ime + ".mp3");
cityImage.setImage(ime + ".jpg");
}
public void act(){
if (downDown != Greenfoot.isKeyDown("down")){
downDown = !downDown;
if (downDown && isTouching(Letalo.class))
Start start = (Start)getWorld();
if (start.izbranoMesto == this){
hoverSound.play();
start.addObject(cityImage, 500, 300);
start.points.points += 10;
start.izberiMesto();
}
else
{
start.points.points -= 5;
}
}
}
if (!hoverSound.isPlaying() && cityImage.getWorld() != null){
getWorld().removeObject(cityImage);
}
}
}