Tag Info

Hot answers tagged

5

Start by adding a variable for the angle that the car is moving at. float angle = Math.Pi / 2; Then add a variable for the current speed. float speed = 0.0; Now create three constants: public static final float acceleration = 0.1; public static final float maxSpeed = 5.0; public static final float rotationRate = Math.Pi / 50; For starters, get your ...


1

First use Zehelvion answer to make the car turn correctly, then: Use the timestamp, you measure how much time it took for your last iteration and use that to modulate the speed at which you are changing things. void RunGame(float deltatime) { if (key.KeyCode == Keys.Up) { Player1.speed += accelaration * deltatime Player1.speed = ...



Only top voted, non community-wiki answers of a minimum length are eligible