Workshop › Tower Defense › Step 9 of 42
Moving along the road is now one line: every frame, every enemy's d grows by SPEED. update holds the game's
rules and runs before draw in the loop.
```js
const SPEED = 0.03 // tiles per frame
function update() {
for (const e of enemies) e.d += SPEED
}
function loop() {
update()
draw()
```PATH write SPEED.function draw() { write update.loop, write update() above draw().Skills: The game loop
← Enemies on the road Off the end of the road →