I'm a new coder and I've been creating a game where a alien crosses a road and to the other side to get to the mother ship without being hit by a car the problem is that the cars keep overlapping each other and don't know how to fix this.
here's the codethis is in the world class
public void act() {
if (Greenfoot.getRandomNumber(100) == 1){
addObject(new Car(),0,Greenfoot.getRandomNumber(200)+200);
}
}
