Hello, i am making a game where you can finish a track with a car. but i dont know how i can let the car move. (up down left and right) Can someone help me with this?
if (Greenfoot.isKeyDown("right")) { move(3); } if (Greenfoot.isKeyDown("left")) { move(-3); } if (Greenfoot.isKeyDown("up")) { setLocation(getX(), getY() - 3); } if (Greenfoot.isKeyDown("down")) { setLocation(getX(), getY() + 3); }