public void hitwall1() { if (isTouching(wall1.class)) { Greenfoot.stop(); //stop the game if the car hits the wall } }
public void hitwall1() { if (isTouching(wall1.class)) { Greenfoot.stop(); //stop the game if the car hits the wall } }
public void act() { hitwall1(); //other code here }