public class Car extends Actor
{
boolean gameStarted = false;
public void act()
{
if(Greenfoot.isKeyDown("w"))
{
gameStarted = true;
}
if (gameStarted == true)
{
move (6);
}
if (Greenfoot.isKeyDown("a") && gameStarted == true)turn(-6);
Actor a = getOneIntersectingObject(tire.class);
if(a != null) {
setLocation(202,521);
setRotation(0);
gameStarted = false;
return;
}
}
}
