I am making a dodgem car game. The direction is working fine but the car just jumps to the other side of the screen. I'm sure this has been asked before but I can't find it. My code is
How do I get the car to move smoothly on the screen? I copied the code from the tutorials but it doesn't work the same.
Thanks!
public void act()
{
move(1);
if (Greenfoot.isKeyDown("left") ) {
setLocation (getX()-1, getY());
turn(-1);
}
if (Greenfoot.isKeyDown("right") ) {
setLocation (getX()+1, getY());
turn(1);
}
if (Greenfoot.isKeyDown("up") ) {
setLocation (getX(), getY()-1);
}
if (Greenfoot.isKeyDown("down") ) {
setLocation (getX(), getY()+1);
}
}
