Workshop › Lunar Lander › Step 9 of 31
On the moon gravity is weak: every frame it adds a little to the falling speed, so the lander drifts down slowly and speeds up.
```js
let gravity
gravity = 0.025
lander.vy += gravity
```gravity is added to vy every frame, before the lander moves.vy is 0.25; the lander has fallen 0.025 × (1 + 2 + ... + 10) pixels.let lander write let gravity.reset, under the lander line, write gravity = 0.025.update, write lander.vy += gravity as the first line.Skills: Velocity and gravity
← The game loop Around the sides →