Workshop › Angry Birds-style Slingshot › Step 11 of 47
Each frame, every body moves by its velocity. step does that for all bodies; update is the game's "change the
state" half and runs before draw in the loop.
```js
function step() {
for (const b of bodies) {
b.x += b.vx
b.y += b.vy
}
}
function update() {
step()
}
function loop() {
update()
draw()
```b.x += b.vx adds the velocity to the position: += means "add to".update calls step; later it will also decide when a shot is over.keydown listener write step and update.loop, write update() above draw().Skills: Velocity and gravity, The game loop