Workshop › OutRun-style Racer › Step 21 of 44
Real cars do not turn when they stand still. We multiply the steering by ratio, the speed compared with the top speed:
0 when standing, 1 at full speed. It is worked out at the very top of update, before the speed changes.
```js
function update() {
const ratio = speed / MAX_SPEED
// Steering works better the faster you go.
const steer = (keys.ArrowRight ? 1 : 0) - (keys.ArrowLeft ? 1 : 0)
playerX += steer * 0.04 * ratio
```ratio = speed / MAX_SPEED goes from 0 (standing) to 1 (top speed).steer * 0.04 * ratio: no steering when standing, full steering at top speed.update write the ratio line and an empty line.steer line write the comment.ratio.Skills: Velocity and gravity
← Steering The grass is slow →