Workshop › Snake › Step 7 of 28
Every game has two jobs: update (change the state) and draw (show it). update moves the head one cell
to the right.
```js
function update() {
head.x += 1
}
```head.x += 1 means "add 1 to head.x": column 5 becomes 6.update does not call it, so nothing moves yet.Write update above function draw() {, with an empty line between them.
Skills: Game states, Functions
← A function that draws The game loop →