Workshop › Flappy-style Bird › Step 5 of 30
Every game has two jobs: update (change the state) and draw (show it). update moves the bird 2 pixels down.
```js
function update() {
bird.y += 2
}
```bird.y += 2 means "add 2 to bird.y": 300 becomes 302. y grows downwards, so the bird goes down.update does not call it, so nothing moves yet.Write update above function draw() {, with an empty line between them. Press Run.
Skills: Game states, Functions
← A function that draws The game loop →