I am making a frogger like video game on greenfoot, and I have a car that bounces off one wall and heads to the other but once it reaches the other wall it stops instead of going back an forth between the walls, what should I do? here is my code.
public void act()
{
if(canSee(Frogger.class))
{
eat(Frogger.class);
Greenfoot.playSound("au.wv");
}
else{
move(7);
}
if(atWorldEdge()){
setRotation(180);
}
}
}
