Workshop › Asteroids › Step 6 of 41
Every frame, update will change the game a little. First job: while left is held the angle gets smaller (turn left),
while right is held it gets bigger (turn right), by TURN radians per frame.
```js
const TURN = 0.07 // radians per frame
function update() {
if (keys.ArrowLeft) ship.angle -= TURN
if (keys.ArrowRight) ship.angle += TURN
}
```ship.angle -= TURN takes 0.07 from the angle, += adds it.SHIP_R write TURN.function drawShip() { write update, followed by an empty line.Skills: Keyboard and mouse input
← Which keys are down? The game loop →