Hi, I am trying to do a project for my computer class but even though the code is correct, the program continues to glitch. In the project, we have to make a car appear at a 3% probability and we are using these strings of code:
World myWorld = getWorld();
if(Greenfoot.getRandomNumber(100)< 3)
{
myWorld.addObject(new Vehicle(), Greenfoot.getRandomNumber(200)+200, 0);
}
Whenever the program runs though, many cars appear and cover the entire screen. Could you please help me?

