Hey Community!
I'm working on a 2D Car Racing game atm. and i was wondering if anyone of you know how to make a good acceleration system for cars. I tried it a few times, but all what i was trying failed.
For example:
When you release "up" the car have to "roll out", so it don't have to stop immediately (don't know how to do it).
The second thing i want to make is, when you drive in a curve you have a small drifting.
Thanks for your help!
private void Tasten2()
{ if(Greenfoot.isKeyDown("w")) {
move(geschwindigkeit);
vorwärts = System.currentTimeMillis();
if (vorwärts != 0 && vorwärts <= System.currentTimeMillis() + 1000000000 && geschwindigkeit == 1)
{
geschwindigkeit = geschwindigkeit + 2;
}
if (vorwärts != 0 && vorwärts <= System.currentTimeMillis() + 2000000000 && geschwindigkeit == 3)
{
geschwindigkeit = geschwindigkeit + 2;
}

