Workshop › Asteroids › Step 14 of 41
Every frame each bullet moves by its velocity and wraps around the screen, exactly like the ship.
```js
for (const bullet of bullets) {
bullet.x = wrap(bullet.x + bullet.vx, canvas.width)
bullet.y = wrap(bullet.y + bullet.vy, canvas.height)
}
```bullet is the object in the list itself, so changing it changes the list.In update, under the ship's two moving lines, leave an empty line and write the loop.
Skills: Velocity and gravity, Loops
← Fire! A lifetime for bullets →